PHP 4.0 Bug #7196: PHPSESSID not working correctly, using script below, with cookies off.

From: Date: Fri, 13 Oct 2000 18:16:58 +0000
Subject: PHP 4.0 Bug #7196: PHPSESSID not working correctly, using script below, with cookies off.
Groups: php.dev 
Request: Send a blank email to php-dev+get-34945@lists.php.net to get a copy of this message
From: cyberlot@cyberlot.net Operating system: Redhat 6.1 PHP version: 4.0.3 PHP Bug Type: *Session related Bug description: PHPSESSID not working correctly, using script below, with cookies off. <?php session_register("count"); printf("$count<BR>"); $count++; printf("$count"); printf("<BR>to count up <A HREF=index.php>Click Here</A> ?> With cookies on everything works.. PHP does add a proper PHPSESSID to the url, however its adding 2 to count every time to click on the page.. Normal strings are saved just fine.. no changes as you click on the link.. If you do not do the $count++ the number does not change at all.. Its only during a change of the number within a session does it mess up... By checking the session tmp file I found the bug happens during the storing off data... session_register does pull the current value within the session tmp file.. However when you change the value of count, a incorrect value is stored.. $count = 10; always returns and stores the number 10.. I made $count = 1, then changes $count++ to $count = $count * 2 Expected results should of been 2 8 16 32 Instead 2 in 2 out 4 in 16 out 32 in 128 out Bottom line it seems I print the last value of count, yet if I made any math changes to count that value is not the value stored If you use a normal string and change it, say from hi, to hello it works, seems to only affect number values note... $count + 1 it stores $count + 2 $count * 2 it stores $count * 4 Somewhere it seems to be redoing the math before storing the number.. With cookies on everything works fine.. -- Edit Bug report at: http://bugs.php.net/?id=7196&edit=1

« previous php.dev (#34945) next »