关闭浏览器窗口而不是单击注销按钮时,销毁会话并注销用户 [英] destroy session and logout a user when browser window is closed instead of clicking logout button

查看:63
本文介绍了关闭浏览器窗口而不是单击注销按钮时,销毁会话并注销用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在关闭浏览器窗口时注销用户,以便在数据库中设置其状态离线" .

当用户单击注销按钮时,设置状态状态离线" 非常容易.

但是,当浏览器窗口关闭或该用户的会话超时到期时,就会出现问题.

问候,

Bunniy ...

Hi,

I want to logout a user when browser window is closed so as to set its status "offline" in the database.

It is quite easy to set the status "offline" when user clicks the logout button.

But, the problem comes when the browser window is closed or the session timeout expires for that user.

with regards,

Bunniy...

推荐答案

在这里检查:

检测通过单击[X]按钮关闭的浏览器 [ http://forums.asp.net/p/1094920/1658155.aspx [ ^ ]
check here:

Detect browser closing through clicks on the [X] button[^]

or

http://forums.asp.net/p/1094920/1658155.aspx[^]


也有看一下:如何检测浏览器关闭事件 [

这篇关于关闭浏览器窗口而不是单击注销按钮时,销毁会话并注销用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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