|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-01-10 05:36 UTC] bbogdan at easylinks dot ro
Description:
------------
A session is not deleted after cookie_lifetime expires and gc run if expiration date is modified in user stored cookie.
Reproduce code:
---------------
ini_set('session.cookie_lifetime', 10);
ini_set('session.gc_maxlifetime', 5);
ini_set('session.gc_divisor', 1);
session_start();
if ( isset($_SESSION['a']) ) {
echo 'is set';
} else {
echo 'is not set';
$_SESSION['a'] = true;
}
Expected result:
----------------
If i manualy modify the cookie to have a longer lifetime (2-3 mins) and rerun the script after 20 seconds i expect the session to be deleted by gc. (works as expected on linux)
Actual result:
--------------
The cookie persists after 10 seconds if you modify the stored cookie lifetime.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 10:00:01 2025 UTC |
5.2.9-2 Windows NT DYPA 5.1 build 2600 Reproduced ini_set('session.cookie_lifetime', 10); ini_set('session.gc_maxlifetime', 5); ini_set('session.gc_divisor', 1); + [Session] session.save_handler = files ;session.save_path = "/tmp" session.use_cookies = 1 ;session.cookie_secure = session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.cookie_httponly = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 100 session.gc_maxlifetime = 1440 session.bug_compat_42 = 1 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = ;session.entropy_length = 16 ;session.entropy_file = /dev/urandom session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 session.hash_function = 0 session.hash_bits_per_character = 4 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="