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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.