On 4/27/07, Aaron Axelsen <lists@xxxxxxxxxxxx> wrote:
I am trying to change my session timeout to 180 minutes, and everything ive tried has not worked. Does anyone have any idea why this isn't working properly? I currently am trying to set the following: session_name('myapp'); $mytimeout = 180 * 60; // minutes * 60 session_set_cookie_params($mytimeout); $sessdir = ini_get('session.save_path')."/myapp"; if (!is_dir($sessdir)) { mkdir($sessdir, 0777); } ini_set('session.save_path', $sessdir); session_cache_limiter(); session_cache_expire($mytimeout); ini_set('session.gc_maxlifetime', $mytimeout); #ini_set('session.gc_probability',1); #ini_set('session.gc_divisor',1); session_start(); -- Aaron Axelsen lists@xxxxxxxxxxxx
session_set_cookie_params requires the number given in seconds, which you did correct. But session_cache_expire requires the number given in minutes. and session.gc_maxlifetime is in minutes again. So that is correct too. you could try replace this: session_cache_expire($mytimeout); with: session_cache_expire($mytimeout / 60); That should fix it, if not, just come back, but then tell us what exactly is wrong, does the session timeout too early? does the session timeout too late? does the session timeout never? Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php