dhl:mvc用户登陆身份验证
登录:
[HttpPost]
public ActionResult LoginSuccess()
{
bool rememberMe = Request["rememberMe"].Contains("true");
UserAccount account = ia.GetUserAccountByUserName(brief.UserName);
//验证成功
string usercookie = account.UIN + "," + brief.UserName;
FormsAuthentication.SetAuthCookie(usercookie, rememberMe);
}
注销:
public ActionResult LoginOut()
{
FormsAuthentication.SignOut();
}
判断是否登陆:
[AuthorizeAttribute]
public ActionResult Payment(int? lid,long? classid)
{}
webcofig:
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
没有登录时候
ie地址栏:

浙公网安备 33010602011771号