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

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

    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

    i have this code
    Response.Buffer = True
    Response.Expire s = 0
    Response.Expire sAbsolute = DateTime.Now.Ad dDays(-1)
    Response.CacheC ontrol = "no-cache"

    but this is not working in mozilla browser
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    Why did you not reply in the topic I gave you this code? Where did you add this code in your page? And do you even understand what it means or didn't you bother to find out?

    Steven

    Comment

    • pulkit goel
      New Member
      • Aug 2010
      • 4

      #3
      Reply to above post

      sir i have applied this code in page load of my login page so that when i logout from my site cache get cleared according to your code n sir its working in IE but not in mozilla

      Comment

      • mzmishra
        Recognized Expert Contributor
        • Aug 2007
        • 390

        #4
        try this
        pages.Response. Cache.SetExpire s(DateTime.Pars e(DateTime. Now.ToString()) )

        Response.Cache. SetCacheability (HttpCacheabili ty.Private)
        Response.Cache. SetNoStore()
        Response.Append Header("Pragma" , "no-cache")

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          Setting the "cache" meta tag is only a suggestion for web browsers and is not going work all the time.

          The only way that I was able to successfully implement such a solution was wrap the page content in an UpdatePanel. When you put your content in an UpdatePanel, everything the user does on the page is done asynchronously. That means when the user hits the back button, the page will appear as if it were the first time loading.

          -Frinny

          Comment

          Working...