Php session timeout

I have some questions regarding php session timeout. I set the following values ​​at runtime:

session.gc_maxlifetime = 3600 session.cookie_lifetime = 3600 session.save_path = myApplicationPath/tmp session.use_cookies = 1 session.use_only_cookies = 1 

However, my session ends in about 30 minutes. In addition, my tmp directory remains empty, so it does not show that cookies are not actually set. echoing ini_get ("session.save_path") returns the correct path, though.

+4
source share
2 answers

Note:

If different scripts have different session.gc_maxlifetime values, but share the same place to store session data, then a script with a minimum value will clear the data. In this case, use this directive together with session.save_path.

PHP manual

+2
source

I would say that PHP cannot find your save_path or cannot write to it, so it stores session files (not cookies) in the default public folder (therefore, the site with the shortest gc_maxlifetime will delete sessions from all other sites).

+1
source

All Articles