HttpResponse pageResponse = HttpContext.Current.Response; Guid sessionToken = System.Guid.NewGuid(); HttpCookie authenticationCookie = pageResponse.Cookies[FormsAuthentication.FormsCookieName]; FormsAuthenticationTicket authenticationTicket = FormsAuthentication.Decrypt(authenticationCookie.Value); authenticationCookie.Expires.AddMinutes(15); FormsAuthenticationTicket newAuthenticationTicket = new FormsAuthenticationTicket( 1, authenticationTicket.Name, authenticationTicket.IssueDate, authenticationTicket.Expiration, authenticationTicket.IsPersistent, sessionToken.ToString(), FormsAuthentication.FormsCookieName); pageResponse.Cookies.Remove(FormsAuthentication.FormsCookieName); HttpCookie newAuthenticationCookie = new HttpCookie( FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(newAuthenticationTicket)); newAuthenticationCookie.HttpOnly = authenticationCookie.HttpOnly; newAuthenticationCookie.Path = authenticationCookie.Path; newAuthenticationCookie.Secure = authenticationCookie.Secure; newAuthenticationCookie.Domain = authenticationCookie.Domain; newAuthenticationCookie.Expires = DateTime.Now.AddMinutes(15); pageResponse.Cookies.Add(newAuthenticationCookie);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)