用户关闭浏览器时注销 [英] logout when user close the browser

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

问题描述


用户关闭浏览器但未注销时注销.

我试图在onuload和onbeload之前在母版页中进行编写,但是当刷新页面并加载每个页面并且用户单击返回时,它会被调用.

我试图在global.asax session_End文件中编写javascript函数,但是当我尝试在该文件中编写javascript时遇到了一些问题

请帮助我解决该问题

预先谢谢..

Hi
logout when user close the browser with out logout.

I tried to write in master page in onuload and onbefore unload but it gets invoked when page is refreshed and every page load and if user click back.

I tried to write javascript function in global.asax session_End file but it had some problem when i try to write javascript in that file

Please help me to fix that problem

Advance Thank You..

推荐答案

我还没有看到一个在所有情况下都可以正常工作的很好的例子:很难确保用户正确注销.而是在关闭浏览器时使cookie过期,并在下次尝试登录时有效注销用户.
I have yet to see a good example of this that works under all circumstances: it is very difficult to ensure that users are logged out properly. Instead, make your cookies expire when the browser is closed, and the user is effectively logged out when he next tries to log in.


http://stackoverflow.com/questions/1824421/detect-browser-close-on-asp-net [ ^ ]
"target =" _ blank"title ="新窗口> ^ ]
希望以上信息对您有所帮助.如果您还有其他顾虑,请告诉我.
http://stackoverflow.com/questions/1824421/detect-browser-close-on-asp-net[^]
http://aspalliance.com/1294_CodeSnip_Handle_Browser_Close_Event_on_the_ServerSide.all[^]
I hope the above information will be helpful. If you have more concerns, please let me know.


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

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