Page 1 of 1
Simple session lifetime
Posted: Wed Jan 23, 2008 3:48 am
by aceconcepts
Hi,
I know this question has been asked time and time again but i simply can't get my session's lifetime to go beyond the default of 24min.
Does anyone know a simple way of increasing or decreasin the session lifetime?
Thanks.
Re: Simple session lifetime
Posted: Wed Jan 23, 2008 3:50 am
by Sindarin
have you tried changing the session.gc_maxlifetime value in php.ini?
Re: Simple session lifetime
Posted: Wed Jan 23, 2008 3:54 am
by aceconcepts
i'm afraid i don't have access to php.ini.
However, would this change work?
Also, is there a way of setting the session lifetime based on a request? i.e. setting it by entering a value in a text box.
Thanks for your prompt response.
Re: Simple session lifetime
Posted: Wed Jan 23, 2008 4:00 am
by vinoth
Its possible to change the session.gc_maxlifetime
by ini_set('session.gc_maxlifetime', $garbage_timeout);. you have to set the timeout values in seconds
I think this will solve that problem.But I was not tested.
Re: Simple session lifetime
Posted: Wed Jan 23, 2008 4:02 am
by aceconcepts
I will give this a go.
Thanks.
Re: Simple session lifetime
Posted: Wed Jan 23, 2008 9:56 am
by pickle
Unfortunately, garbage collection of old sessions uses the value in php.ini, not whatever you set via ini_set(). The only way to change this value is by modifying php.ini.
Re: Simple session lifetime
Posted: Wed Feb 13, 2008 1:39 am
by vinoth
Any Possible way to modify the php.ini file through programming.
Re: Simple session lifetime
Posted: Wed Feb 13, 2008 4:57 am
by aceconcepts
vinoth wrote:Any Possible way to modify the php.ini file through programming.
This was also part of my initial point.