php_dev Posted June 18, 2008 Share Posted June 18, 2008 hello, i want to change session time.the session time should differ according to section of my module. i have tried with this function ini_set('session.gc_maxlifetime',but then also its not happening. plz help me. thanks in advance Link to comment https://forums.phpfreaks.com/topic/110730-changing-session-time-out-in-php/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 18, 2008 Share Posted June 18, 2008 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. Link to comment https://forums.phpfreaks.com/topic/110730-changing-session-time-out-in-php/#findComment-568194 Share on other sites More sharing options...
php_dev Posted June 19, 2008 Author Share Posted June 19, 2008 even i have tried with setting cookie using this function "setcookie("TestCookie", $orgInfo[3], time()+28800); " ..then also my session is expiring... help me... Link to comment https://forums.phpfreaks.com/topic/110730-changing-session-time-out-in-php/#findComment-569052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.