이것은 로그인이 성공하면 호출되는 내 함수입니다. 내가FormsAuthenticationTicket이 너무 빨리 만료됩니다.
<authentication mode="Forms">
<forms loginUrl="~/Default/Login" timeout="540" />
</authentication>
내가 사용자의 체류를 9 시간에 로그인 할 가지고있는 Web.config의에서
public static void CreateLoginCookie(User u)
{
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(u.Id.ToString(), true, 9*60);
string encryptedTicket = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket) { Expires = DateTime.Now.AddHours(9) };
HttpContext.Current.Response.Cookies.Add(cookie);
}
(I이 FormAuthentication 것은 매우 새로운 오전),하지만 작동하지 않습니다. 1 시간이나 2 시간 후에 로그 아웃됩니다.
누군가 내가 누락 된 내용을 말해 줄 수 있습니까?
는 당신이 티켓이 아닌 만료되는 세션의 확신 :
이 질문은 당신과 관련이? –