php_novice2007 Posted August 8, 2007 Share Posted August 8, 2007 Hi, Is it possible to set an expiration on php sessions? And how would I do that? thanks~! Link to comment https://forums.phpfreaks.com/topic/63960-php-sessions/ Share on other sites More sharing options...
hostfreak Posted August 8, 2007 Share Posted August 8, 2007 http://www.php.net/manual/en/function.session-cache-expire.php Link to comment https://forums.phpfreaks.com/topic/63960-php-sessions/#findComment-318816 Share on other sites More sharing options...
Orio Posted August 8, 2007 Share Posted August 8, 2007 Nope, you need to use he session.gc_maxlifetime directive. <?php ini_set("session.gc_maxlifetime ", 60); //session expires after one min ?> Orio. Link to comment https://forums.phpfreaks.com/topic/63960-php-sessions/#findComment-318826 Share on other sites More sharing options...
hostfreak Posted August 8, 2007 Share Posted August 8, 2007 Ah, my mistake. Link to comment https://forums.phpfreaks.com/topic/63960-php-sessions/#findComment-318894 Share on other sites More sharing options...
php_novice2007 Posted August 9, 2007 Author Share Posted August 9, 2007 Hi, I put ini_set() on the first page before I call session_start() and session_register('username') where I check for the user name and password. I set the time to 1 minute but it doesn't seem to have any effect. Do I have to use ini_set() on all the subsequent pages thats call session_start()? Thanks! Link to comment https://forums.phpfreaks.com/topic/63960-php-sessions/#findComment-318981 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.