My Symfony2 application displays a main page, and from there on it primarily uses AJAX requests to display content to the user via modals.
I\'ve noticed that after t
The problem:
It turns out that on Debian / Ubuntu systems, there is a system cronjob which runs every 30 minutes, cleaning out all "old" sessions. Herein lies the problem.
The cronjob doesn't actually know what constitutes "old". The cronjob simply calls a PHP-CLI script located at /usr/lib/php5/maxlifetime
which then removes all session files that exceed a certain age. Since the script is involved by PHP-CLI, and independently of Symfony2, it has no idea what values you specified for gc_maxlifetime
and cookie_lifetime
in your Symfony2 config file. Instead, if just defaults to using the session.cookie_lifetime
and session.gc_maxlifetime
values from the /etc/php5/cli/php.ini
config file, which by default, is 24 minutes. So no matter what you specify in your Symfony2 config file, if you are idle for too long, your session will be removed.
The solution:
/etc/cron.d/php5
or,