【发布时间】:2010-03-10 13:19:11
【问题描述】:
我的 web 应用程序 (asp.net mvc rc2) 中的会话有问题。该应用程序在 asp.net mvc rc1 上运行良好。
我使用以下代码进行会话超时处理:
if (cnt.Current.Session != null)
{
if (cnt.Current.Session.IsNewSession)
{
string cookie = cnt.Current.Request.Headers["Cookie"];
if ((null != cookie && (cookie.IndexOf("ASP.NET_SessionId") >= 0))
{
return true;
}
}
}
当 i 成为会话超时时,使用 FormsAuthentication.SignOut(); 方法让用户注销并重定向到登录页面。
新登录后cnt.Current.Session.IsNewSession 始终为真!! (漏洞?)
在 rc1 上工作正常。
【问题讨论】:
-
你是在 Cassini 还是 IIS 上进行测试?它在 cassini 中不起作用,但可以在 IIS 上运行
标签: asp.net-mvc session