C# MVC 客户端cookie缓存导致验证出错问题

同一个域的不同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();
}

  

posted on 2012-03-14 00:35  大宝pku  阅读(557)  评论(0编辑  收藏  举报

导航