日期:2014-05-17 浏览次数:20437 次
string roles = "Job_System"; FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, strAccount, DateTime.Now, DateTime.Now.AddMinutes(30), false, roles); string encryptedTicket = FormsAuthentication.Encrypt(authTicket); //加密 HttpCookie UserCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket); Context.Response.Cookies.Add(UserCookie); //写入
------解决方案--------------------
完整教程
ASP.NET Cookie 概述
http://msdn.microsoft.com/zh-cn/library/ms178194%28VS.80%29.aspx