Cookie 添加身份票据并设置ReturnURL
Cookie 添加身份票据并且设置ReturnURLFormsAuthenticationTicket Ticket = new FormsAuthenticationTicket(1, userName, DateTime.Now, DateTime.Now.AddMinutes(30), false, userRoles);
//加密序列化票为字符串
string HashTicket = FormsAuthentication.Encrypt(Ticket);
//生成Cookie
HttpCookie UserCookie = new HttpCookie(FormsAuthentication.FormsCookieName, HashTicket);
HttpCookie cookie = new HttpCookie("ReturnUrl", "passport/Login.aspx")
两个new 怎么揉在一块呢?
--------------------编程问答-------------------- 为什么要揉在一块呢?
用两个不行吗?
Response.Cookies.Add
作为两条。。。。
补充:.NET技术 , ASP.NET