且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

你如何编程的asp.net结束会话时Session.Abandon()不起作用?

更新时间:2023-02-15 23:12:01

这是最有可能的,因为你的 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.