Your php_info()
proves that the settings are applied.
Are you on Debian or Ubuntu ? In such case, there's a caveat: debian mantainers have patched the PHP package to clear unused sessions via crontab. (the above could apply not only to Debian/Ubuntu, depends on the distro mantainers)
# /etc/cron.d/php5: crontab fragment for php5
# This purges session files older than X, where X is defined in seconds
# as the largest value of session.gc_maxlifetime from all your php.ini
# files, or 24 minutes if not defined. See /usr/lib/php5/maxlifetime
# Look for and 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) -print0 | xargs -n 200 -r -0 rm
Such decentralization is thus being done basing on global settings, not on a per process basis.
I see two solutions:
- after 20 minutes or so (use time() to know when you're above the time threshold) you close the session with
session_write_close()
and open it again.
- you implement your own session handler with session_set_save_handler and save your session data somewhere else than the default path.
Whichever route you choose I suggest you to retain the modifications you did to .htaccess.
Let us know how it goes :-)