I am using a the basic login on a test ASP.Net MVC 5 site (for an internet site).
The login works fine but when I try to logout it doesn't happen. The logout link does call the following controller action:
public ActionResult LogOff()
{
AuthenticationManager.SignOut();
return RedirectToAction("Index", "Home");
}
But the user stays logged in. How do I ensure that the user actually gets logged out?
I had this problem before, change:
AuthenticationManager.SignOut();
To:
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
Assuming that you are using ApplicationCookie to store your login information.