PHP 4.0 Bug #7196 Updated: PHPSESSID not working correctly, using script below, with cookies off.
| From: | sas@php.net | Date: | Mon, 16 Oct 2000 18:11:53 +0000 |
| Subject: | PHP 4.0 Bug #7196 Updated: PHPSESSID not working correctly, using script below, with cookies off. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35169@lists.php.net to get a copy of this message | ||
ID: 7196
Updated by: sas
Reported By: cyberlot@cyberlot.net
Status: Closed
Bug Type: *Session related
Assigned To:
Comments:
The rewriter has been changed to not rewrite <img> tags by default. That is user configurable
now.
Previous Comments:
---------------------------------------------------------------------------
[2000-10-13 14:16:58] cyberlot@cyberlot.net
<?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..
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7196