php - For how long are the sessions valid when the browser is closed? -
when use session.cookie_lifetime = 0
in php, cookie deleted browser when it's closed. server has no way know this, relies on fact cookie won't used again.
what want know how long session valid on server side, in case recovers cookie.
for debian linux system there cron job cleans "dead" sessions.
the max lifetime in php.ini file
/etc/cron.d/php5
: crontab fragment php5
this purges session files older x, x defined in seconds largest value of session.gc_maxlifetime php.ini files, or 24 minutes if not defined. see /usr/lib/php5/maxlifetime
.
look , purge old sessions every 30 minutes:
09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete
Comments
Post a Comment