Re: echo SESSION var doesn't work if unset after echo

From: Date: Tue, 09 Dec 2008 21:51:47 +0000
Subject: Re: echo SESSION var doesn't work if unset after echo
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-284388@lists.php.net to get a copy of this message
I have two vars doing the same thing. One is echo'd/unset in the <head></head> section and the other echo'd/unset in the footer of the page. No re-direct request is being made. Ok now check this. If I use this code: if(isset($_SESSION["Ecomm"])) { echo $_SESSION["Ecomm"]; unset($_SESSION["Ecomm"]); } I can *NOT* see the Ecomm contents in the right-click -> View Page Source. I do see the complete in the "View Generated Source". Now, If I comment out the unset: if(isset($_SESSION["Ecomm"])) { echo $_SESSION["Ecomm"]; // unset($_SESSION["Ecomm"]); } Then I *CAN* see the Ecomm code in the in the right-click -> View Page Source as well as the "View Generated Source". I am very humbled right now..... -eric wood ----- Original Message ----- From: <ceo@l-i-e.com>
My theory is that the browser is RE-requesting the data because of the private, must-revalidate. So it goes like this: Browser -> GET -> Ecomm: fooie ; unset Ecomm Browser -> GET -> Ecomm: [not set]


« previous php.general (#284388) next »