110,571
社区成员
发帖
与我相关
我的任务
分享
FormsAuthenticationTicket Ticket = new FormsAuthenticationTicket(1, UserKey, DateTime.Now, DateTime.Now.AddDays(1), true, "", FormsAuthentication.FormsCookiePath);
string HashTicket = FormsAuthentication.Encrypt(Ticket); //得到加密后的身份验证票字串
HttpCookie UserCookie = new HttpCookie(FormsAuthentication.FormsCookieName, HashTicket);
//生成Cookie
HttpContext.Current.Response.Cookies.Add(UserCookie); //输出Cookie