PHP Session problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fareast Adam
    New Member
    • Feb 2007
    • 51

    PHP Session problem

    How to maintain a session from page to page? I'm getting a problem here when i try to logout, the session is destroy but i still can go inside to that page without login first by using IE Back button or history cache! How can i solve that? Anybody help me please...
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by Fareast Adam
    How to maintain a session from page to page? I'm getting a problem here when i try to logout, the session is destroy but i still can go inside to that page without login first by using IE Back button or history cache! How can i solve that? Anybody help me please...
    Welcome to theScripts.

    You may have to specify that the page not be cached, and make sure that you not only destroy the session, but clear the $_SESSION array:
    [PHP]
    $_SESSION = array();
    [/PHP]

    Comment

    • Fareast Adam
      New Member
      • Feb 2007
      • 51

      #3
      Thanks Motoma for reply! But how can you show that will be running? Can you give me some explanation. Regard!

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        Originally posted by Fareast Adam
        Thanks Motoma for reply! But how can you show that will be running? Can you give me some explanation. Regard!
        The no cache part of my previous post is demonstrated quite well here.

        Comment

        • Fareast Adam
          New Member
          • Feb 2007
          • 51

          #5
          i would like to give some example here, simply even for this forum if you logout from your accout you still can be go to your site withuot enter a user name and password by click Back botton! There is a dangerious that other people can threat badly inside your accout! Regard...

          Comment

          • Motoma
            Recognized Expert Specialist
            • Jan 2007
            • 3236

            #6
            Originally posted by Fareast Adam
            i would like to give some example here, simply even for this forum if you logout from your accout you still can be go to your site withuot enter a user name and password by click Back botton! There is a dangerious that other people can threat badly inside your accout! Regard...
            This is called caching. Browsers do this to save on bandwidth.
            If you log out from this site, and then hit the back button you can stil see a page but that's okay...If you try to continue on to another page after you log out, you are told to log back in again.

            Comment

            Working...