]> granicus.if.org Git - php/commitdiff
fix wrong gc sequence
authorAnatol Belski <ab@php.net>
Fri, 29 Jan 2016 14:18:59 +0000 (15:18 +0100)
committerAnatol Belski <ab@php.net>
Fri, 29 Jan 2016 14:18:59 +0000 (15:18 +0100)
ext/session/session.c

index 52ba7e300ab41e14f87672261ae46689ea2975f1..d67045ed8977b436614f31139f5a097c2b02473a 100644 (file)
@@ -543,9 +543,6 @@ static void php_session_initialize(void) /* {{{ */
        php_session_reset_id();
        PS(session_status) = php_session_active;
 
-       /* GC must be done before read */
-       php_session_gc();
-
        /* Read data */
        php_session_track_init();
        if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, PS(gc_maxlifetime)) == FAILURE) {
@@ -555,6 +552,10 @@ static void php_session_initialize(void) /* {{{ */
                php_error_docref(NULL, E_NOTICE, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path));
                */
        }
+
+       /* GC must be done after read */
+       php_session_gc();
+
        if (PS(session_vars)) {
                zend_string_release(PS(session_vars));
                PS(session_vars) = NULL;