I have a problem. I have done custom "Remember Me" functionality using cookies.
HttpCookie rememberMeCookie = FormsAuthentication.GetAuthCookie(userName, rememberMe);
if (rememberMe)
{
rememberMeCookie.Expires = Controller.LocalizationProvider.GetAdjustedServerTime().AddMonths(6);
}
HttpContex开发者_JAVA技巧t.Current.Response.Cookies.Add(rememberMeCookie);
I see the cookie in firecookies tools in the Firefox. It exists and has the correct expiration date. But when I changed time - moved to next month. After that I entered to the site and I unlogged user. If I return to present time - I became authothication user.
May be formsauthentication timeout in your web.config is interferring. Here is what MSDN has to say:
Under ASP.NET V1.1 persistent cookies do not time out, regardless of the setting of the timeout attribute. However, as of ASP.NET V2.0, persistent cookies do time out according to the timeout attribute.
精彩评论