1

I have been distroyed the session once user logged out, but when clicking on the back button i can see the previous pages.I tried session timeout and all but it doesn't work for me.How can i resolve this issue. Its asp.net MVC Web application

public ActionResult LoggedOut()
{
   HttpContext.Session.Timeout = 1;
   HttpContext.Session.Clear();
   Session.Abandon();
   Session.RemoveAll();
   Session.Clear();
   return View();
 }
Naveen
  • 1,441
  • 2
  • 16
  • 41

1 Answers1

0

This is always the case, the previous page is only displaying the old view. If the previous page is refreshed the page will give an error, because the controller is rolling, and than there are no sessions declaired.

One option you can do is to close the current page that is open. Than they can't come back to the previous page.

Way to close page: How do you close an ASP.NET MVC page from the controller?

Update:

I have looked at some websites how the log out works there, in a lot of cases it is so that it says something like:

Sign out: close browser to complete sign out You must close your browser to complete the sign out process.

So you have to close the page by manually.

Community
  • 1
  • 1
Max
  • 846
  • 1
  • 9
  • 26