Jump to content

changing session time out in php.....


php_dev

Recommended Posts

The shortest 'session.gc_maxlifetime' of any script that runs will be what is used. Any time garbage collection (GC) runs, all session data files found with a file time older than the 'session.gc_maxlifetime' will be deleted. So, if you have a script using a 2000 second setting and one using a 1000 second setting, should GC run when the 1000 second setting script is requested, than any files older than 1000 seconds will be deleted.

 

The purpose of the 'session.gc_maxlifetime' setting is to delete older session data files. It is not for use by a script to end sessions at specific times. It is not a timeout setting.

 

From the php manual about what session.gc_maxlifetime is for -

session.gc_maxlifetime integer

session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up. Garbage collection occurs during session start.

 

Note: If different scripts have different values of session.gc_maxlifetime but share the same place for storing the session data then the script with the minimum value will be cleaning the data. In this case, use this directive together with session.save_path.

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.