0

我的LogOff操作仅适用于第一个会话 - 来自同一台计算机上其他浏览器的其他会话无法注销。

此外,LogOff当请求已被服务器缓存时,不会调用该操作。

这是我的LogOff行动:

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult LogOff()
{
    MvcAuthentication.Models.ConfirmList.Remove();
    AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
    return RedirectToAction("Index", "Home");
}

什么会阻止其他浏览器会话注销?

4

1 回答 1

1
    [OutputCacheAttribute(VaryByParam = "*", Duration = 0, NoStore = true)]              
    public ActionResult Logout()
    {         
        Session.RemoveAll();
        FormsAuthentication.SignOut();          
        return RedirectToAction("Index","Home");
    }

尝试这个

于 2015-10-01T04:25:44.707 回答