Page 1 of 1

Increase user session time for 10 hours?

Posted: Wed May 14, 2008 2:55 am
by jimjack145
Hi All,

I want to set session time to all users of 10 hours. How will i set this time into php.ini file?

However php.ini having default values for all session variable.

Please suggest advice for the same.

Regards,
Jimi

Re: Increase user session time for 10 hours?

Posted: Wed May 14, 2008 4:05 am
by lafever
This should be in PHP Code.

In your php.ini the sessioon.gc_maxlifetime controls how long a session lasts until it expires in seconds so 10 hours in seconds == 36000

Code: Select all

 
session.gc_maxlifetime = 36000
 

Re: Increase user session time for 10 hours?

Posted: Wed May 14, 2008 4:30 am
by jimjack145
Hi lafever,

Thanks for your reply.

However in my php.ini file a session.gc_maxlifetime have default value as 1440 it mean session will get expire after 24 mins.

Other session variables have default value as it is. Example:
1) session.cookie_lifetime = 0 (ifetime in seconds of cookie; or if 0, until browser is restarted)
2) session.cache_expire = 180 ; document expires after n minutes

Will i need to change above variable values?

I got confused between two variable
1) session.cookie_lifetime and 2) session.gc_maxlifetime

Thanks for reply. I will do need full changes at my end and reply you soon.

Regards,
Jimi

Re: Increase user session time for 10 hours?

Posted: Thu May 15, 2008 2:38 am
by jimjack145
Hi lafever,

Thanks for your help. My problem has solved.

In my php.ini file i have changed a variable value of "session.gc_maxlifetime= 36000".

Regards,
Jimi