Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Logout -> Browser Back Button = Login Page

Logout -> Browser Back Button = Login Page

Scheduled Pinned Locked Moved Web Development
csharpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    butchzn
    wrote on last edited by
    #1

    Hi Guys, When i LogOut a user on my site a User is still able to hit the Back button in their browser and essentially view a logged in only page. :( Ideal scenario would be for this page to send them to Login screen. What would be the best way to stop this from happening? FYI. When a user logs in, i store a loggedIn value in a session variable. On logout i reset this session to indicate the user is loggedOut. I am using c# .net Many Thanks. :)

    C S 2 Replies Last reply
    0
    • B butchzn

      Hi Guys, When i LogOut a user on my site a User is still able to hit the Back button in their browser and essentially view a logged in only page. :( Ideal scenario would be for this page to send them to Login screen. What would be the best way to stop this from happening? FYI. When a user logs in, i store a loggedIn value in a session variable. On logout i reset this session to indicate the user is loggedOut. I am using c# .net Many Thanks. :)

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Why did you double post this ?

      Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

      1 Reply Last reply
      0
      • B butchzn

        Hi Guys, When i LogOut a user on my site a User is still able to hit the Back button in their browser and essentially view a logged in only page. :( Ideal scenario would be for this page to send them to Login screen. What would be the best way to stop this from happening? FYI. When a user logs in, i store a loggedIn value in a session variable. On logout i reset this session to indicate the user is loggedOut. I am using c# .net Many Thanks. :)

        S Offline
        S Offline
        Shog9 0
        wrote on last edited by
        #3

        The browser will cache pages, unless you ask it not to. Read up on the cache control headers.

        Citizen 20.1.01

        'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups