]> granicus.if.org Git - php/commitdiff
(Missing patch from the PHP 4 tree that got lost in the shuffle)
authorRasmus Lerdorf <rasmus@php.net>
Fri, 10 Feb 2006 07:39:13 +0000 (07:39 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Fri, 10 Feb 2006 07:39:13 +0000 (07:39 +0000)
 See: http://cvs.php.net/viewcvs.cgi/php-src/ext/session/session.c?r1=1.336.2.39&r2=1.336.2.40
- fix logic. if the client already sent us the cookie, we don't
  need to send it again.  if the id has been changed, we need to
  update the client side.

ext/session/session.c

index d546fed0b1046b0e3e68544d89044b127dd27d47..a15549c4335f842a137b5e2bc36b31f127a94351 100644 (file)
@@ -1088,8 +1088,9 @@ static void php_session_reset_id(TSRMLS_D)
 {
        int module_number = PS(module_number);
        
-       if (PS(use_cookies)) {
+       if (PS(use_cookies) && PS(send_cookie)) {
                php_session_send_cookie(TSRMLS_C);
+               PS(send_cookie) = 0;
        }
 
        /* if the SID constant exists, destroy it. */
@@ -1485,6 +1486,7 @@ PHP_FUNCTION(session_regenerate_id)
        
                PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC);
 
+               PS(send_cookie) = 1;
                php_session_reset_id(TSRMLS_C);
                
                RETURN_TRUE;