Re: login system question, amplified

From: Date: Sun, 13 Apr 2003 17:01:22 +0000
Subject: Re: login system question, amplified
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143674@lists.php.net to get a copy of this message
I agree with domains' reply but am not sure it answers the question. I am a relative newby to PHP, have found it extremely easy to work with, and consequently have rolled my own user login/authentication system using mySQL when I have needed one. So I haven't gotten around to mastering the PHP session handling functions. I took Daniel's question to be: How can I list the users who currently have active sessions if I am using the PHP session handling functions. That sent me back to the manual ( http://www.php.net/manual/en/ref.session.php ) and I didn't see an explicit description of how to read out the current sessions under the default configuration. I believe the PHP system defaults to creating a file under /tmp for each session. Listing all current sessions would mean reading each of these files and checking to see if it has expired. Am I right? Is there a patch of code floating around somewhere that demonstrates how to do this? Thanks, --Frappy On Sunday 13 April 2003 01:57 am, domains@modwest.com wrote: > 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.

« previous php.general (#143674) next »