在浏览器关闭Session_End中code [英] Session_End code on browser close

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

问题描述

我有一个方法,我需要在Session_End中运行。有什么办法,我可以保证code运行,当用户关闭浏览器?这可能是一个DUP queston。我看到一个响应做阿贾克斯卸载或东西的电话,但我不希望这火每次用户从一个页面导航走,只是当他们关闭浏览器。

I have a method I need to run on Session_end. Is there any way I can ensure the code runs when a user closes his browser? This may be a dup queston. I saw one response doing a call to ajax unload or something, but I don't want this to fire everytime a user navigates away from a page, just when they close their browser.

谢谢,
〜CK

Thanks, ~ck

推荐答案

Session_End中是不可靠的。无论你做什么。

Session_end is unreliable. No matter what you do.

Session_End中只有火灾时,你正在使用进程内会话。如果您使用的是会话状态服务器或SQL会话,Session_End中不火。

Session_end only fires when you are using inprocess session. If you are using a session state server or SQL session, session_end does not fire.

在使用过程中的会话,只有Session_End中火,如果你已经存储在会话的东西。如果你不使用会话,Session_End中不会触发。

When using in process session, session_end only fires if you have stored something in session. If you aren't using session, session_end will never fire.

如果您正在使用会话和用户关闭浏览器,将Session_End中时触发用户的会话超时。虽然会有一些相同的设置为初始会话,这一事件不会被捆绑到一个浏览器,因为它是工作进程检测会话超时和烧制的过程Session_End中

If you are using session and the user closes the browser, session_end will fire when the users session times out. While it will have some of the same settings as the original session, this event will not be tied to a browser since it is the worker process detecting the session timeout and firing the session_end process.

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

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