日期:2014-05-17 浏览次数:20469 次
var authTicket = new FormsAuthenticationTicket(1,userName,DateTime.Now, DateTime.Now.AddMinutes(30),false, userData, FormsAuthentication.FormsCookiePath); string encTicket = FormsAuthentication.Encrypt(authTicket); var authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket); authCookie.Domain = ".xxxxxxxxxx.xx"; authCookie.Expires = authTicket.Expiration; Context.Response.Cookies.Add(authCookie);