]> granicus.if.org Git - php/commitdiff
Fixed Bug #71122 Session GC may not remove obsolete session data
authorYasuo Ohgaki <yohgaki@php.net>
Tue, 15 Dec 2015 01:27:28 +0000 (10:27 +0900)
committerYasuo Ohgaki <yohgaki@php.net>
Tue, 15 Dec 2015 01:27:28 +0000 (10:27 +0900)
ext/session/session.c

index eca1ddb4cce692f1beb7032e8bfe42041f43255b..49749219ab623981f1f2f6e2bf87a97ec4824678 100644 (file)
@@ -1608,9 +1608,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
                PS(id) = NULL;
        }
 
-       php_session_initialize(TSRMLS_C);
-       php_session_cache_limiter(TSRMLS_C);
-
+       /* GC must be done before reading session data. */
        if ((PS(mod_data) || PS(mod_user_implemented)) && PS(gc_probability) > 0) {
                int nrdels = -1;
 
@@ -1624,6 +1622,9 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
 #endif
                }
        }
+
+       php_session_initialize(TSRMLS_C);
+       php_session_cache_limiter(TSRMLS_C);
 }
 /* }}} */