111,119
社区成员
发帖
与我相关
我的任务
分享
string userData = 你的用户名 + "," + 用户角色 + "," + 用户所属机构 + "," + 叉叉叉状态+","+等等;
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, response.AccountAbbr, DateTime.Now, DateTime.Now.AddMinutes(30),true, userData);
string encryptedTicket = FormsAuthentication.Encrypt(ticket); //加密
HttpCookie authCookie =new HttpCookie(FormsAuthentication.FormsCookieName,encryptedTicket);
Response.Cookies.Add(authCookie);
每天一贴