当前位置:编程学习 > C#/ASP.NET >>

Cookie 添加身份票据并设置ReturnURL

Cookie 添加身份票据并且设置ReturnURL 
FormsAuthenticationTicket 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
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,