你如何编程的asp.net结束会话时Session.Abandon()不起作用? [英] How do you programatically end a session in asp.net when Session.Abandon() doesn't work?
问题描述
Session.Abandon()似乎并没有做任何事情。您所期待的Session_End中事件,火灾时Session.Abandon()被调用。
Session.Abandon() doesn't seem to do anything. You would expect the Session_end event to fire when Session.Abandon() is called.
推荐答案
这是最有可能的,因为你的 SessionMode
是的不的是InProc
(在会话结束时,可以检测的唯一的一个)。
This is most likely because your SessionMode
is not InProc
(the only one that can detect when a session ends).
引:
会话活动
ASP.NET提供了两个事件帮助
您管理用户会话。该
Session_OnStart事件引发时,
新的会话启动,和
Session_OnEnd事件引发时,
会话被废弃或过期。
会话事件是在指定
为ASP.NET Global.asax文件
应用程序。
ASP.NET provides two events that help you manage user sessions. The Session_OnStart event is raised when a new session starts, and the Session_OnEnd event is raised when a session is abandoned or expires. Session events are specified in the Global.asax file for an ASP.NET application.
该Session_OnEnd事件不
支持如果会话模式属性
被设定为比是InProc以外的值,
这是默认的模式。
The Session_OnEnd event is not supported if the session Mode property is set to a value other than InProc, which is the default mode.
这篇关于你如何编程的asp.net结束会话时Session.Abandon()不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!