Re: login system question
| From: | domains at modwest dot com | Date: | Sun, 13 Apr 2003 05:57:37 +0000 |
| Subject: | Re: login system question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143644@lists.php.net to get a copy of this message | ||
Since the http protocol is stateless, you really can never know when a
user has left your site or turned off their computer.
All you can do is make a judgement about how long a login session will
last, and then make the login cookie expire (or take their login cookie
away if the database record for expiry time associated with their login
cookie is past) after that amount of time, forcing the person to login
again.
You can do something like resetting a new cookie with an extended login
expiry time, (or increasing the expiry time in your database if that is
how you decide to track it) every time the user hits a new page on your
site. That would make it so that someone who was constantly clicking
links on your site would not run out of time and find that thir session
has ended.
--
http://modwest.com
PHP/MySQL web hosting
On Sat, 12 Apr 2003, daniel wrote:
> hi guys , i would like to know how i could check users who are online and who
> arent , basically i would like to do the who is online feature, but how can i
> tell when they go offline say if they set a cookie ? or when the session ends,
> also i would like to use this info to prevent the user being locked out on
> multiple logins, i have a bit of a flaw when i am preventing multiple logins ,
> say i login on one screen, then i login on another screen the first screen
> gets logged out, i'd theoretically would want to prevent the second screen to
> login , any ideas let me know thanks.
>
>
>
>