View Full Version : Are Session Expirations possible in PHP?

01-21-2004, 01:43 AM
I'm wondering if this is possible. I was suggested to do the following to expire a session:

session_cache_expire(5); // expires in 5 minutes

The problem is that the session does not expire. I use that for a login script and I'm still able to browse after more than a day goes by and even if the browser is closed. Is there a way to do this without changing a configuration file? I've searched other posts and the manual without luck.

Do other web apps that use login scripts rely on setcookie or sessions? Any help is appreciated. Thanks!

01-21-2004, 06:31 AM
A session expires automatically after 26 - 30 mins if the user is idling. 5 mins is a bit short

01-21-2004, 12:32 PM
This function is only available to version 4.2.0...

Anyways it recommended you use session_cache_limiter (http://uk.php.net/manual/en/function.session-cache-limiter.php) along with it. I recommened you have a look at the users comments on that pages as IE can produce some strange results unless you configure php correctly to avoide this.