同一个域的不同MVC应用会共享相同的 ASPXAUTH cookie, 导致出现 Request.IsAuthenticated 和 [Authorize] 不一致的情况

参考这个

http://stackoverflow.com/questions/4050925/page-user-identity-isauthenticated-still-true-after-formsauthentication-signout

 

在 Login 控制器中,删除登录cookie

 

if (HttpContext.User.Identity.IsAuthenticated)
{
	FormsAuthentication.SignOut();
}

  

相关文章:

  • 2021-10-12
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2021-06-14
猜你喜欢
  • 2021-11-25
  • 2022-12-23
  • 2021-05-29
  • 2021-10-02
  • 2021-12-28
相关资源
相似解决方案