当用户关闭浏览器时终止用户会话 [英] kill user session when user close browser
本文介绍了当用户关闭浏览器时终止用户会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人
当用户通过Alt + F4或关闭窗口选项+文件菜单->关闭浏览器时,我想终止用户会话.退出选项等
Dear All
I want to kill user session when user close browser through Alt+F4 OR Close Window option + File Menu - > Exit option etc
推荐答案
此 [此 [ ^ ].
这是您提出问题时右侧准则中的第一点.
This[^] and this[^].
It''s the first point in the guidelines on the right hand side when you ask questions.
也许这可以为您提供帮助!
0)使用脚本检测窗口关闭事件(使用lib或您自己的).
1)并添加自定义Ajax代码以将查询发送到杀死会话的页面.
示例(javascript代码):
maybe this can help you!
0) use a script to detect window closing event (use lib or your own).
1) and add you custom Ajax code to sent query to your page that kill session.
example (javascript code):
<script type="text/javascript">
window.onunload = function() {
alert("Here Ajax Code to page killsession.aspx");
};
</script>
示例(killsession.aspx页):
example (killsession.aspx page):
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Session.Abandon()
End Sub
这篇关于当用户关闭浏览器时终止用户会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文