Re: Session lifetime

From: Date: Thu, 28 Dec 2000 17:57:47 +0000
Subject: Re: Session lifetime
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-32117@lists.php.net to get a copy of this message
I don't think that's builtin to the PHP session support at this time... You could create a table in your database with UID and timestamp, and update it on each page hit. Then, either through a cron job or on each page hit, delete all the sessions that are older than 5 minutes. You could then check your own table to be sure their UID is valid, or delete old sessions when you delete the records. It would probably be a good Feature Request for you to add at http://bugs.php.net to have this builtin so that URL-based sessions were more like cookie sessions, IMNSHO. You could maybe also code it so that instead of using a database, you check the filemtime() (filectime?) and see when their session data was last modified. If it's more than 5 minutes ago, their session is "stale" and should be deleted and then you can redirect them to an error page. ----- Original Message ----- From: "Daniel B I" <bignat@mail.com> Newsgroups: php.general Sent: Thursday, December 28, 2000 4:51 AM Subject: [PHP] Session lifetime > Please, can anybody tell me how to set the lifetime > of a session without cookies, in PHP 4? > I mean only with GET/POST method,in a linux environment? > I modified the values in the php.ini file, but it seems to have there only > references to the cookie-style session lifetime.. > > I don't have the session id removed from the > /tmp directory.. and I dont want'em to stay there more than 5 minutes, > for example. > > Thank you, > Daniel BI > > > > -- > 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 >

« previous php.general (#32117) next »