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. Linux, Apache, MySQL, PHP
  4. Php Sessions

Php Sessions

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
questionphphelp
4 Posts 4 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.
  • N Offline
    N Offline
    nishinilu
    wrote on last edited by
    #1

    Hi, Can someone please tell me how I can control user logins using session? for expample, when the user logouts from the account, he is redirected back to the home page. but, if he clicks back the account is displayed again. this means the session was not ended. how can i get over this problem? thnks in advance

    G C A 3 Replies Last reply
    0
    • N nishinilu

      Hi, Can someone please tell me how I can control user logins using session? for expample, when the user logouts from the account, he is redirected back to the home page. but, if he clicks back the account is displayed again. this means the session was not ended. how can i get over this problem? thnks in advance

      G Offline
      G Offline
      Gerben Jongerius
      wrote on last edited by
      #2

      You are forgetting to terminate the session on logout, or at least clear out the session variables that you are using to detect if someone is logged in. Because it is so hard to Google for how to terminate a session, here is the link http://www.php.net/manual/en/function.session-destroy.php[^]

      1 Reply Last reply
      0
      • N nishinilu

        Hi, Can someone please tell me how I can control user logins using session? for expample, when the user logouts from the account, he is redirected back to the home page. but, if he clicks back the account is displayed again. this means the session was not ended. how can i get over this problem? thnks in advance

        C Offline
        C Offline
        Claudio Ludovico Panetta
        wrote on last edited by
        #3

        On the logout.php you need to set up this

        session_unset() ;
        session_destroy() ;

        www.malorgio.it

        1 Reply Last reply
        0
        • N nishinilu

          Hi, Can someone please tell me how I can control user logins using session? for expample, when the user logouts from the account, he is redirected back to the home page. but, if he clicks back the account is displayed again. this means the session was not ended. how can i get over this problem? thnks in advance

          A Offline
          A Offline
          Arunkumar Koloth
          wrote on last edited by
          #4

          You can also store sessions to database it is a good way to manage user sessions.

          Arunkumar

          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