关闭浏览器后如何注销 [英] How to log out after close the browser

查看:147
本文介绍了关闭浏览器后如何注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello all :)



我在旧网站使用会话来保存登录数据,是否有办法让用户在关闭浏览器后退出?





提前感谢:)

Hello all :)

I used sessions at old web site to save log in data, is there a way to make user logged out after closing the browser ?


thanks in advance :)

推荐答案

尝试 window.onbeforeunload java脚本事件。它会在关闭浏览器之前触发。您可以使用该事件来调用ajax请求以强制会话输出或重定向到已注销的页面。
Try with window.onbeforeunload java script event. It will fire before closing the browser. you can use that event to call the ajax request to force session out or redirect to the logged out page.


这篇关于关闭浏览器后如何注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆