C# MVC 客戶端cookie緩存導致驗證出錯問題
同一個域的不同MVC應用會共享相同的 ASPXAUTH cookie, 導致出現 Request.IsAuthenticated 和 [Authorize] 不一致的情況
參考這個
在 Login 控制器中,刪除登錄cookie
if (HttpContext.User.Identity.IsAuthenticated)
{
FormsAuthentication.SignOut();
}
同一個域的不同MVC應用會共享相同的 ASPXAUTH cookie, 導致出現 Request.IsAuthenticated 和 [Authorize] 不一致的情況
參考這個
在 Login 控制器中,刪除登錄cookie
if (HttpContext.User.Identity.IsAuthenticated)
{
FormsAuthentication.SignOut();
}