【发布时间】:2019-05-18 04:03:12
【问题描述】:
我在 ASP.NET MVC 2 项目中配置了我的Web.Config 文件如下:
<sessionState mode="InProc" timeout="1"/>
并在Global.asax.cs中添加了以下内容:
protected void Session_End(object sender, EventArgs e)
{
System.Diagnostics.Debug.WriteLine("Session_End");
}
protected void Session_Start(object sender, EventArgs e)
{
System.Diagnostics.Debug.WriteLine("Session_Start");
}
Session_Start() 在新用户访问网站时被调用。我本来希望在 1 分钟的空闲时间后调用 Session_End(),但事实并非如此。我错过了什么吗?
【问题讨论】:
标签: asp.net-mvc web-config session-state session-timeout