]> granicus.if.org Git - php/commitdiff
- fix logic. if the client already sent us the cookie, we don't
authorSascha Schumann <sas@php.net>
Wed, 23 Jun 2004 16:29:16 +0000 (16:29 +0000)
committerSascha Schumann <sas@php.net>
Wed, 23 Jun 2004 16:29:16 +0000 (16:29 +0000)
  need to send it again.  if the id has been changed, we need to
  update the client side.

ext/session/session.c

index 3bd0e28399c80acaa072f4f52a04d5ee34b3c362..7098f1d4420a50f3e3df64fac65c0df6865549d8 100644 (file)
@@ -930,8 +930,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. */
@@ -1283,6 +1284,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;