]> granicus.if.org Git - php/commitdiff
Fixed bug #42135 (Second call of session_start() causes creation of SID)
authorIlia Alshanetsky <iliaa@php.net>
Sun, 29 Jul 2007 14:43:30 +0000 (14:43 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 29 Jul 2007 14:43:30 +0000 (14:43 +0000)
NEWS
ext/session/session.c

diff --git a/NEWS b/NEWS
index 78d6bcd1a8cf96eaa9e9d84a0568a4f95df1a5a1..3eae7a5ab0d838287df8a53f5a7d877a917f10b8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -70,6 +70,8 @@ PHP                                                                        NEWS
 - Fixed PECL bug #11216 (crash in ZipArchive::addEmptyDir when a directory 
   already exists). (Pierre)
 
+- Fixed bug #42135 (Second call of session_start() causes creation of SID).
+  (Ilia)
 - Fixed Bug #42112 (deleting a node produces memory corruption). (Rob)
 - Fixed Bug #42107 (sscanf broken when using %2$s format parameters). (Jani)
 - Fixed bug #42090 (json_decode causes segmentation fault). (Hannes)
index 3de93efe87e7358184bc6e96949a83bc1b62a211..3dfda00d6f263657816d706ee64374f1b02c972f 100644 (file)
@@ -1221,10 +1221,7 @@ PHPAPI void php_session_start(TSRMLS_D)
 
        PS(apply_trans_sid) = PS(use_trans_sid);
 
-       PS(define_sid) = 1;
-       PS(send_cookie) = 1;
        if (PS(session_status) != php_session_none) {
-               
                if (PS(session_status) == php_session_disabled) {
                        char *value;
 
@@ -1241,6 +1238,9 @@ PHPAPI void php_session_start(TSRMLS_D)
                
                php_error(E_NOTICE, "A session had already been started - ignoring session_start()");
                return;
+       } else {
+               PS(define_sid) = 1;
+               PS(send_cookie) = 1;
        }
 
        lensess = strlen(PS(session_name));