我在我的web應用程序(asp.net mvc rc2)中遇到了會話問題。該應用程序在asp.net mvc rc1上正常工作。ASP.NET MVC RC2 - 會話處理錯誤?
我使用後續代碼會話超時處理:
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();
方法用於用戶註銷一個重定向到loginpage。 新登錄後是cnt.Current.Session.IsNewSession
永遠是真的! (BUG?) 在rc1上工作正常。
你在卡西尼或IIS上測試嗎?它在cassini中不起作用,但可用於IIS – chugh97 2011-06-16 15:42:33