php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7196 PHPSESSID not working correctly, using script below, with cookies off.
Submitted: 2000-10-13 14:16 UTC Modified: 2000-10-16 14:11 UTC
From: cyberlot at cyberlot dot net Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.3 OS: Redhat 6.1
Private report: No CVE-ID: None
 [2000-10-13 14:16 UTC] cyberlot at cyberlot dot 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..

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-16 14:11 UTC] sas@php.net
The rewriter has been changed to not rewrite <img> tags by default. That is user configurable now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 06:01:29 2024 UTC