How to restrict the user to login by browser back button even after log out in

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pulkit goel
    New Member
    • Aug 2010
    • 4

    How to restrict the user to login by browser back button even after log out in

    I am working on web application. I am facing a problem that when logout from my website i was redirected to my login page but when i click on back button of browser i was again able to access my web pages that should be visible after login. Please help me its very urgent
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    I usually don't give out code this easily, but I'm in a good mood ;-)

    Add the following code to the click-event of your logoff button.
    Code:
    Response.Buffer = True
    Response.Expires = 0
    Response.ExpiresAbsolute = DateTime.Now.AddDays(-1)
    Response.CacheControl = "no-cache"
    That should do the trick.

    Steven

    Comment

    Working...