slidingexpiration

Form authentication slidingExpiration does not work

为君一笑 提交于 2019-12-10 15:32:01
问题 I have below code int intTimeout = (FormsAuthentication.Timeout.Hours * 60) + FormsAuthentication.Timeout.Minutes; var authTicket = new FormsAuthenticationTicket(1, Utility.userCookie, DateTime.Now, DateTime.Now.AddMinutes(intTimeout), true, cookieValue); string strEncryptedTicket = HttpUtility.UrlEncode(FormsAuthentication.Encrypt(authTicket)); var authCookie = new HttpCookie(Utility.userCookie, strEncryptedTicket); authCookie.Expires = authTicket.Expiration; //FormsAuthentication