logout using session

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pardhu
    New Member
    • Jun 2007
    • 3

    logout using session

    I have been trying out the sessions in PHP. Am able to log into a my site and sessions for that particular logged on session. My problem is with the logout. Am unsetting and destorying the session on my way out but when I click on the back button on my browser, I am able to view my last visited page. how can i get around this?
  • ronnil
    Recognized Expert New Member
    • Jun 2007
    • 134

    #2
    does your page have a protect function disabling to view it without the session variable set?

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, pardhu. Welcome to TSDN!

      You're likely seeing this behavior because your browser cached the page. When you click the back button, no request is actually getting sent to the server; the browser is serving up a copy from its cache of saved pages instead.

      Try pressing the back button and then clicking on any of the links on that page. You should be redirected to your login page.

      Check out this article for more info on browser caching and how to prevent it.

      Comment

      • pardhu
        New Member
        • Jun 2007
        • 3

        #4
        Originally posted by ronnil
        does your page have a protect function disabling to view it without the session variable set?


        I haven't use any oops concept.I have given session_start() ; to every page,

        and at the end in the logout page i started the session and also destroyed the

        session.

        Comment

        Working...