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:
Maybe this is related to the bug #22117 , that I reported yesterday? http://bugs.php.net/bug.php?id=22117 Previous Comments: ------------------------------------------------------------------------ [2003-02-04 13:05:49] [EMAIL PROTECTED] Just wanted to check in on this bug and see if any progress has been made...thanks. ------------------------------------------------------------------------ [2003-01-27 17:45:14] [EMAIL PROTECTED] Ok, sorry, I didn't realize we weren't allowed to use Oracle in our samples. Can you please follow these steps then to reproduce the bug: 1. Copy and paste the following code into a file, save file with .php extension. _______________________________________________________ <?php session_start(); $r = $HTTP_REFERER; echo "<h2>PHP 4.3.0 BUG</h2>"; echo "<p>r is "; var_dump($r); $w = "hello"; session_register( "r" ); $x = "bananas"; $y = 5; $z = 777; echo "<p>w is " . $w . " (should be \"hello\")\n"; echo "<p>x is " . $x . " (should be \"bananas\")\n"; echo "<p>y is " . $y . " (should be 5)\n"; echo "<p>z is " . $z . " (should be 777)\n"; ?> ________________________________________________________ 2. Open up the file you just saved in a web browser, copy the url in your browser, and then close the browser. (Goal is to make sure $HTTP_REFERER is null.) 3. Open up a clean browser, and paste the url to that file location and press enter. 4. You should see the weird assignment statements there. Just so you can see what my browser said, here is my output: PHP 4.3.0 BUG r is NULL w is hello (should be "hello") x is 777 (should be "bananas") y is 777 (should be 5) z is 777 (should be 777) Thanks, and sorry for not providing a short, complete, self-contained sample script earlier. I misunderstood the definition of short, complete, self-contained script. ------------------------------------------------------------------------ [2003-01-27 17:35:48] [EMAIL PROTECTED] So far every script in this report is buggy and can't possibly work. So fix your scripts first. Self-contained means that they can be run anywhere, regardless if there is oracle available or not. (ie. get rid of the oracle stuff in it) Short means it's less that 15 lines. Complete means it's all there, between <?php and ?> tags. ------------------------------------------------------------------------ [2003-01-27 16:38:52] [EMAIL PROTECTED] Oh, I should mention--- if you visit my demonstration, copy the link into your browser, do not click on it from here. If $HTTP_REFERER is actually set to something other than NULL the bug does not occur. Stephen. ------------------------------------------------------------------------ [2003-01-27 16:27:48] [EMAIL PROTECTED] 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. ------------------------------------------------------------------------ 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