Last day a friend wrote me that he had a problem with Debian your server. Exactly did not keep his sessions more than 30 minutes no matter how much is set session.gc_maxlifetime. In general, the problem is that Debian has decided to rewrite the behavior of the sessions as instead garbage collector-and a cron is started every 9th and 39th minute that clears the old sessions. Тои се намира в /etc/cron.d/php5
generally a simple script that starts / usr / lib / php5 / maxlifetime and contains the variable how long the life of the cookie is 1440 seconds or 24 minutes 😉 From now on there are 2 option or to stop the cron and thus stop the automatic cleaning which can later be reconfigured by php.ini or directly in the script to change the lifespan of the sessions with the variable max. I personally prefer the second option. It is much cleaner in general but there is a drawback – if the file is overwritten, our changes will be lost, which is an unpleasant fact.
ps. Now that you think about it, if you define another place to store your information via php itself, it should go beyond the scope of the script and thus be used again in a normal session without interrupting it roughly..
ini_set('session.gc_maxlifetime', 14400); ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100); session_save_path(APP_PARENT_DIR . '/sessions');