Anti-Forgery Token was meant for a different claims-based user

前端 未结 7 1816
有刺的猬
有刺的猬 2020-12-28 13:41

I am working on a logout feature in the application we are using ASP.NET Identity login. I can login successfully but when I logout and then try to login again I get the fol

7条回答
  •  长情又很酷
    2020-12-28 14:07

    Try this:

    public ActionResult Logout()
    {
        AuthenticationManager.SignOut();
        Session.Abandon();
        return RedirectToAction("Index");
    }
    

    That will reload your login page which will provide you a new CSRF token.

提交回复
热议问题