1
사용자가 설정을 변경할 수있는 모양을 제어하는 'UI'설정이 있지만 쿠키를 업데이트해야합니다.C# 사용자가 로그인하지 않고 쿠키를 업데이트하십시오.
업데이트 할 수있는 것 같지만 사용자가 다시 인증하도록해야합니다. 사용자에게 다시 인증을 부여하지 않고 쿠키를 업데이트하려면 어떻게해야합니까?
//We need to update the userToken as the menuOptionChanged
var usertoken2 = new UserToken(schedule.MinimisedMenuBool);
HttpCookie cookie = FormsAuthentication.GetAuthCookie(usertoken.UserName, false);
var ticket = FormsAuthentication.Decrypt(cookie.Value);
var newticket = new FormsAuthenticationTicket(ticket.Version,ticket.Name,ticket.IssueDate,ticket.Expiration,false,usertoken2.CalculateRawToken(),ticket.CookiePath);
// Encrypt the ticket and store it in the cookie
cookie.Value = FormsAuthentication.Encrypt(newticket);
System.Web.HttpContext.Current.Response.Cookies.Set(cookie);
좋은 점은, 그런 생각조차하지 못했습니다. –