Php – Apache making the session time out longer


I already altered my php.ini in Apache to have these settings:

session.gc_maxlifetime = 1440
session.cache_expire = 1500

But my sessions are not that long. The problem is that I am not certain which settings would "do the trick"

Ideally I am looking for the right configuration to have the session last 12 hours. Could anyone help me with that?

Best Solution

do you also have set session.cookie_lifetime = 0 ? and maybe somewhere in your scripts or some included scripts the session lifetime is set to another value?

The default "0" value means that the cookie stays alive until the browser is closed. This is also the default value, if not set in php.ini. Source:

Related Question