tags:

views:

60

answers:

1

Anybody can help on how to increase session expiry in php through htaccess?

So far I got this:

php_value session.cookie_lifetime 14400
php_value session.gc_maxlifetime 14400
php_value session.gc_probability 1
php_value session.gc_divisor 1

If I'm not mistaken, the life time of the cookie will be of 4 hours. What I'm trying to do is to increase the idle time of the session only, not the session cookie. Right now, after 4 hours I get kick out from my app. Can someone help me on how to o this?

Thanks

A: 

The lifetime of the session is bound to cookie_lifetime and gc_maxlifetime, which are respectively the lifetime of the cookie and the lifetime of data into your session. That being said, a session can't survive without a cookie so cookie_lifetime as to be greater or equal to gc_maxlifetime; otherwise, no garbage collection of your data will be done and cookie will expire before any data can possibly expire.

JP