浏览器关闭asp.net时杀死会话
问题描述:
你好,
当浏览器或标签关闭时如何杀死会话.plz提示代码,我在谷歌搜索2天但是,我没有得到任何成功,PLZ帮助我
hello,
How to kill session when browser or tab is closed.plz provode the code, I search in 2 days in google but ,I am not get any sucess, plz help me
答
当浏览器关闭时,您无法清除会话。你可以处理窗口卸载事件并触发一个AJAX调用,但你不能确定它会触发。
相关主题:
如何在用户关闭浏览器后立即终止会话? [ ^ ]
在浏览器或选项卡关闭时关闭/终止会话 [ ^ ]
这是一篇文章:
当浏览器为clo时,服务器中的会话终止(注销)在ASP.NET中使用交叉按钮/ ALTF4进行定位 [ ^ ]
--Amit
You can not clear the session when the browser closes. You can handle the window unload event and fire an AJAX call, but you can''t be sure it will fire.
Related Threads:
How to kill the session as soon as user closes the browser?[^]
Close/kill the session when the browser or tab is closed[^]
Here is an article:
Session killing (logout) in server when browser is closed using cross button/ALTF4 in ASP.NET[^]
--Amit