Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.Net MVC 5 w/identity 2.2.0 Log off not working

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?

like image 235
John S Avatar asked Feb 21 '15 04:02

John S


1 Answers

I had this problem before, change:

AuthenticationManager.SignOut(); 

To:

AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie); 

Assuming that you are using ApplicationCookie to store your login information.

like image 138
Ashley Medway Avatar answered Sep 20 '22 10:09

Ashley Medway