PHP 4.0 Bug #5953 Updated: Session invalidates when newline character is inserted into a session variable

From: Date: Fri, 04 Aug 2000 19:30:04 +0000
Subject: PHP 4.0 Bug #5953 Updated: Session invalidates when newline character is inserted into a session variable
Groups: php.dev 
Request: Send a blank email to php-dev+get-27742@lists.php.net to get a copy of this message
ID: 5953 User Update by: mbeers@udeco.com Status: Open Bug Type: Session related Description: Session invalidates when newline character is inserted into a session variable Here is some sample code to reproduce the problem: <? session_start(); session_register("beforeLF"); session_register("testVarLF"); session_register("testVarNoLF"); $beforeLF = "A string before that with linefeeds"; $testVarNoLF = "A string without linefeeds"; $testVarLF = "A string with linefeeds\nmore\nmore\n"; print "click <a href=\"test2.php\">here</a> to continue<br><br>"; ?> beforeLF: <pre><?= $beforeLF ?></pre> end; <br><br> testVarLF: <pre><?= $testVarLF ?></pre> end; <br><br> testVarNoLF: <pre><?= $testVarNoLF ?></pre> end; in another file (in this case called test2.php): <? session_start(); ?> beforeLF: <pre><?= $beforeLF ?></pre> end; <br><br> testVarLF: <pre><?= $testVar ?></pre> end of the output of the testVar <br><br> testVarNoLF: <pre><?= $testVarNoLF ?></pre> end; On my system, the variables don't print out at all. However, if you comment out the $testVarLF variable in the first file, everything comes out fine. (except of course a value for that variable, because it is not set). Also, if you change it to not include newline characters, it works. Full Bug description available at: http://bugs.php.net/?id=5953

« previous php.dev (#27742) next »