标签:null current cookie setcookie hash ticket div sha icp
var ticket = new FormsAuthenticationTicket(1, username, DateTime.Now, DateTime.Now.AddMinutes(FormsAuthentication.Timeout.Minutes), true, JsonConvert.SerializeObject(userinfo), FormsAuthentication.FormsCookiePath); HttpContext.Current.User = new GenericPrincipal(new FormsIdentity(ticket), null); var hash = FormsAuthentication.Encrypt(ticket); CookieHelper.SetCookie(FormsAuthentication.FormsCookieName, hash, FormsAuthentication.FormsCookiePath, DateTime.Now.AddMinutes(FormsAuthentication.Timeout.Minutes), true, FormsAuthentication.RequireSSL);
标签:null current cookie setcookie hash ticket div sha icp
原文地址:http://www.cnblogs.com/hualiu0/p/6340454.html