Jump to content

PHP Session


dizzy1

Recommended Posts

session_cache_expire

 

That would be the function you are after. You will need to place that before the session_start call for it to work.

 

Sorry the above was wrong information.

 

ini_set('session.gc_maxlifetime', 300);
session_start();

 

Where 300 is how long in seconds you want it to live. Place that before the session_start and it should only last as long as you set it to.

Link to comment
https://forums.phpfreaks.com/topic/152401-php-session/#findComment-800399
Share on other sites

Someone probably did that to this person to screw him over - http://www.phpfreaks.com/forums/index.php/topic,246085.0.html

 

The only thing session garbage collection should be used for is to remove old session data files.

 

If you want a specific time check on your site, store the last access time and check how long ago it was on each page access and take appropriate action.

Link to comment
https://forums.phpfreaks.com/topic/152401-php-session/#findComment-800430
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.