echo SESSION var doesn't work if unset after echo
| From: | Eric Wood | Date: | Tue, 09 Dec 2008 18:41:15 +0000 |
| Subject: | echo SESSION var doesn't work if unset after echo | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-284368@lists.php.net to get a copy of this message | ||
I set Ecomm to a little javascript code on the previous page then echo it no the next page.
session_cache_limiter ('private, must-revalidate');
session_start();
..... stuff ...
if(isset($_SESSION["Ecomm"])) {
echo $_SESSION["Ecomm"];
unset($_SESSION["Ecomm"]);
}
..... stuff ...
For some unknown reason echoing this particular session var is now blank and the page's source
code proves that it is missing.
Now when I comment out the unset statement, then the crazy thing works. I see the code in the
page's source.
It is as if php is doing this:
if(isset($_SESSION["Ecomm"])) {
unset($_SESSION["Ecomm"]);
echo $_SESSION["Ecomm"];
}
No kernel, apache, or php updates have happened. An there's not errors logged. Truely
strange. Any ideas?
-Eric Wood