RE: [PHP] session expiration (browser close or time)
| From: | Samantha Savvakis | Date: | Thu, 07 Sep 2000 01:00:42 +0000 |
| Subject: | RE: [PHP] session expiration (browser close or time) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15625@lists.php.net to get a copy of this message | ||
I've implemented sessions, when a person logs into the site, or however you
want to do it. They are assigned a unique session ID with a LASTUSED time
recorded against it. I store the SESSION_ID in a cookie or however you wish
to store it.
Each time a page is hit, the LASTUSED time is updated, providing it hasn't
exceeded my MAX timeout of 15 minutes.
If they haven't done anything for 15 minutes, and they try to do something,
they are prompted that they have been logged out and must log back in. This
requires that each page on my site checks the LASTUSED time for the
SESSIONID. It works well.
It also works so a user can only log into the site "once" at any given point
in time. This means, users cannot share userids. If they do, the person who
first logged onto the site will be kicked off and they will be notified that
it was because another person has used their userid.
About the session.cookie_lifetime stuff, I haven't used it so I can't
comment on that. I have set my cookies so that they are unlimited for the
lifetime of the browser. As soon as the browser closes, they are destroyed.
I do not store cookies locally on PC's.
> -----Original Message-----
> From: Brent Edwards [mailto:wbe@purdue.edu]
> Sent: Thursday, 7 September 2000 10:45
> To: php-general@lists.php.net
> Subject: [PHP] session expiration (browser close or time)
>
>
> What I would like to do is expire a session after a set amount of
> time, or when the
> browser is closed-which ever comes first.
>
> I understand session.cookie_lifetime, but when I set it to a
> value it seems the
> session is still open after the browser is closed.
>
> Thanks in advance.
>
> --
> Brent Edwards
> Network Engineer - wbe@purdue.edu
> Purdue University Data Network
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>