Joh*_*n S 36 asp.net-mvc logout asp.net-mvc-5 asp.net-identity-2
我在测试ASP.Net MVC 5站点(用于Internet站点)上使用基本登录.
登录工作正常,但当我尝试注销时,它不会发生.注销链接会调用以下控制器操作:
public ActionResult LogOff()
{
AuthenticationManager.SignOut();
return RedirectToAction("Index", "Home");
}
Run Code Online (Sandbox Code Playgroud)
但用户仍然保持登录状态.如何确保用户实际登出?
Ash*_*way 50
我以前遇到过这个问题,改变:
AuthenticationManager.SignOut();
Run Code Online (Sandbox Code Playgroud)
至:
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
Run Code Online (Sandbox Code Playgroud)
假设您使用ApplicationCookie存储登录信息.
归档时间: |
|
查看次数: |
10832 次 |
最近记录: |