处理在ASP.NET中过期的会话

时间:2012-10-11 12:08:15

标签: asp.net

我们可以在ASP.net中延长会话过期时间的方式有多少?

1 个答案:

答案 0 :(得分:1)

您可以在Session_End中使用Global.asax,在会话结束时提出事件

链接:http://msdn.microsoft.com/en-US/library/ee255109(v=bts.10).aspx

public class Global : System.Web.HttpApplication
{
        void Session_End(object sender, EventArgs e)
        {
            // Code that runs when a session ends. 
            // Note: The Session_End event is raised only when the sessionstate mode
            // is set to InProc in the Web.config file. If session mode is set to StateServer 
            // or SQLServer, the event is not raised.

        }

}