Question:

How does my PHP script get to know when a user's session has ended?

by  |  earlier

0 LIKES UnLike

I guess the better question is what exactly goes on behind the scenes server-side when a user's session expires? I'm still a bit unclear on this aspect.

 Tags:

   Report

2 ANSWERS


  1. A user's session actually controlled by its cookie. When the browser's cookie names "PHPSESSID" expires, so will the session. So, if you work on extending this cookie, you might increase your session time.

    Of course, this means that:

    1- You can reduce the session time by overwriting the PHPSESSID value or deleting the session using "session_destroy";

    2- You must make sure that the clients' browsers supports cookies.

    Good luck!


  2. Well it Times Out or a user clicks on a link that Kills the session.

    The time out and/or command to Kill the session are all in the script.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.