Sunday, 15 September 2013

PHP: Sessions never expire

PHP: Sessions never expire

Last night I logged in and the following morning I was still logged in,
even if I quit my browser. I want the session to expire after a few hours
and I thought that it would work with "session.gc_maxlifetime" set to
"1440" and "session.cache_expire" set to "180"
Here is what I could find from PHP.ini
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx
session.auto_start Off
session.bug_compat_42 Off
session.bug_compat_warn Off
session.cache_expire 180
session.cache_limiter nocache
session.cookie_domain no value
session.cookie_httponly Off
session.cookie_lifetime 0
session.cookie_path /
session.cookie_secure Off
session.entropy_file no value
session.entropy_length 0
session.gc_divisor 1000
session.gc_maxlifetime 1440
session.gc_probability 0
session.hash_bits_per_character 5
session.hash_function 0
session.name PHPSESSID
session.referer_check no value
session.save_handler files
session.save_path /var/lib/php5
session.serialize_handler php
session.use_cookies On
session.use_only_cookies On
session.use_trans_sid 0
On our old server we used the same settings and the sessions worked. The
only difference from the old one is the "session.save_handler" that is set
to "memcache" on the old server. Also "session.save_path" is different.

No comments:

Post a Comment