ID: 20583 Comment by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Session related Operating System: RedHat 7.2 PHP Version: 4CVS-2002-11-22 (stable) New Comment:
Hi, I am sorry to hear the frustration! My script is self contained, and is of the minimum length to reproduce the problem. Just add some php tags! If you want to see similar code in action, see here: http://www.stephensykes.com/holwiz/ Note that the bug only occurs if you are creating the session for the first time - hence the session destroy at the top. If you session_register the variable $r before setting it, the bug does not occur. More specifically, it is only AFTER $r is registered that all variable assignments begin to take on the last value assigned. Regards Stephen. Previous Comments: ------------------------------------------------------------------------ [2003-01-27 11:12:10] [EMAIL PROTECTED] I'm completely baffled here. Can you please explain how the two self-contained short scripts provided above are NOT samples of "_SHORT_, _COMPLETE_ and _SELF CONTAINED_ example scripts" ?? We've given you code to produce the bug in less than 20 lines. I don't know how many lines you are expecting us to reproduce the bug with? Thanks ------------------------------------------------------------------------ [2003-01-27 04:56:08] [EMAIL PROTECTED] Please provide a _SHORT_, _COMPLETE_ and _SELF CONTAINED_ example script. It's still some bug in your script, NOT in PHP.. ------------------------------------------------------------------------ [2003-01-26 12:12:51] [EMAIL PROTECTED] Ok, this is happening in 4.3.0. It does not happen in 4.2.2. Here is some self contained code: session_start(); session_destroy(); session_start(); $r = $HTTP_REFERER; session_register( "r" ); echo "<p>r is "; var_dump($r); $z = 0; $x = 999; $y = 777; echo "<p>x is " . $x . "\n"; echo "<p>z is " . $z . "\n"; echo "<p>y is " . $y . "\n"; I get $r is NULL, and 777 for all three of $x, $y and $z from this script. Something is badly wrong. ------------------------------------------------------------------------ [2003-01-23 14:00:26] [EMAIL PROTECTED] Haven't heard anything back on this bug in a while. Just wondering what the status was on this one, or if you've had any luck reproducing it with the code segment I provided. ------------------------------------------------------------------------ [2003-01-10 01:14:39] [EMAIL PROTECTED] I experienced the described problem with one of my scripts, too, since I upgraded the server to PHP 4.3.0. I use sessions, MySQL, and have cookies turned on in my browser. In my script I process post data and assign three values to session variables inside an if-statement. Changing the order in which the assignments are made (I moved the first statement after the other two) solved the problem, and all variables contain their correct values. I use Debian 3.0 (Woody), Apache 1.3.27 with statically linked PHP 4.3.0. PHP configuration: http://bigben171.wutallan.net/phpinfo.php ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/20583 -- Edit this bug report at http://bugs.php.net/?id=20583&edit=1