ID: 34862 Updated by: [EMAIL PROTECTED] Reported By: Lhunath at Pandora dot Be -Status: Open +Status: Bogus Bug Type: Session related Operating System: Linux Gentoo PHP Version: 5.0.5 New Comment:
>I will continue an attempt to isolate the issue. No problem. Feel free to reopen the report when you get the real reproduce script. Previous Comments: ------------------------------------------------------------------------ [2005-10-13 23:41:47] Lhunath at Pandora dot Be You are entirely correct; my example seems to not suffer from this issue, I just made a mistake in the code. However; I posted it due to a problem I encountered in my own website. I seem to have failed to isolate the problem. If you go to this page: http://riello.lyndir.com/?lang=nl you will see a page in Dutch (NL). Pressing the top right button "Francais", the page will change to French (FR). This will happen through the variable "lang" which is set to "fr" using GET. The page will be French. Mark that in the red debugging output you can see that in the variable $_SESSION [lang] => fr. When you click a link on the navigation bar now, the value "fr" of the variable "lang" is lost and reset to "nl" - the original. Should you originally use a different value for lang - "en" for example; it will restore the value to "en" after having clicked a random link on the french page. (The page is only available in French or Dutch). I will continue an attempt to isolate the issue. ------------------------------------------------------------------------ [2005-10-13 23:21:06] [EMAIL PROTECTED] Remove this: if($t) or use if($_GET['t']) instead and it'll work. ------------------------------------------------------------------------ [2005-10-13 23:12:00] Lhunath at Pandora dot Be Description: ------------ After a variable has been stored in the session file, it's content is available and visible in the file. However, when later the variable's content is altered; the file's content is not. It remains the same initial value. Because of this, the modification is lost. (the session file can be altered in this way: new variables can be added with their value. the session file cannot be altered in this way: existing variables in the file cannot have their value changed) Reproduce code: --------------- Avaria tmp # cat page1.php <?php session_start(); $_SESSION["test"] = "1"; ?> <a href="page2.php?t=2">go to page 2</a> Avaria tmp # cat page2.php <?php session_start(); if($t) $_SESSION["test"] = $_REQUEST["t"]; echo $_REQUEST["t"]; echo $_SESSION["test"]; ?> <a href="page3.php">go to page 3</a> Avaria tmp # cat page3.php <?php session_start(); echo $_SESSION["test"]; ?> Expected result: ---------------- go to page 2 22go to page 3 2 Actual result: -------------- go to page 2 21go to page 3 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34862&edit=1