Re: Changing Session Timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, April 27, 2007 1:37 pm, tedd wrote:
> At 12:26 PM -0500 4/27/07, Aaron Axelsen wrote:
>>With the following set, its still timing me out.  I logged in and
>>waited about 40 minutes, and it was timed out by then.  This is
>>getting very confusing, what else could it be that is causing this to
>>not work?
>>
>>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);
>>
>>// New Attempt
>>session_cache_limiter();
>>session_cache_expire($mytimeout / 60);
>>ini_set('session.gc_maxlifetime', $mytimeout);
>>#ini_set('session.gc_probability',1);
>>#ini_set('session.gc_divisor',1);
>>
>>session_start();
>>
>
> The above is not the order of your code, is it?
>
> If so, move session_start(); to the top, namely the first line of
> code.


I don't think you want to do that...

You want all those settings to take effect BEFORE you actually start
the session which sends out the headers.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux