-1

有多少种方法可以延长 ASP.net 中的会话过期时间?

4

1 回答 1

1

您可以尝试使用Session_Endin 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.

        }

}
于 2012-10-11T12:14:52.330 回答