asp.net webForm登录授权

HttpCookie cookie;
cookie = FormsAuthentication.GetAuthCookie(W3Account, isRemberMe);
if (isRemberMe)
{
       cookie.Expires = System.DateTime.Now.AddDays(1);
}
HttpContext.Current.Response.Cookies.Add(cookie);
string targetUrl;
targetUrl = FormsAuthentication.GetRedirectUrl(W3Account, isRemberMe);
HttpContext.Current.Response.Redirect(targetUrl);
原文地址:https://www.cnblogs.com/aweifly/p/3413975.html