操作身份验证

if (FormsAuthentication.GetRedirectUrl(customerID, false).ToLower().EndsWith("default.aspx")) {
        FormsAuthentication.SetAuthCookie(customerID, false);
                        Response.Redirect("VerifySignIn.aspx");
                    }                        
                    else {
                    
                        FormsAuthentication.RedirectFromLoginPage(customerID, false);
                    }                        
FormsAuthentication:身份操作
如果操作成功返回上次用户访问的页面
并写入cookie集合当中
否则
将已身份验证的用户重定向起初的URL....

FormsAuthentication.SignOut();移除身份验证票
原文地址:https://www.cnblogs.com/wuhuihui_dotnet/p/199667.html