[PHP] Sorry....sessions ... again...with code...
|Hello all, I'm mad with mesorry but see if can understand why I'm mad. Copy the 3 attached files, and run it. In one.php just click to the link (it works.), now in two.php you can see: " and now: aaa", cool hum... Clicking in OFF link you can see the result of phpinfo, but section of Apache Evironment, in HTTP_COOKIE you (at least I have) the PHPSESSID with value, in spite of in off.php code I make a session_destroy Now if you use history back button, go to two.php, and OK the session variable dont appear, Back again, Forward and voila' here is a. I have try to follow some Jeff Armstrong tips, but I have no success.Thank you very much Jeff (really...I'm no jocking...). Any ideas ?? T.Y all Best Regards Miguel Loureiro [EMAIL PROTECTED] CODE: one.php ? session_start(); session_register("a"); $a="a"; ? html body form a href="two.php" 2 /a /form /body /html two.php ? session_start(); ? html body and now : ?echo $a? a href="off.php"OFF/a /body /html off.php ? session_start(); unset($a); session_destroy(); phpinfo(); ?
RE: [PHP] Sorry....sessions ... again...with code...
I have tried you code and cannot see any real problem? This is what I see happening: 1 one.php creates a session and sets the value of $a to 'a' 2 click on 2 and you get to two.php with the value set to 'a' 3 click on OFF and you get to off.php where the value is unset 4 click back and you go back to two.php, and $a has no value 5 click back and you go to one.php which then creates a new session and puts 'a' back into $a phpinfo() shows that the browser is sending you a PHPSESSID cookie, but as your variables are correctly unset, this should never be a problem. When you call session_start() php is automatically going to create a PHPSESSID cookie anyway, so even if you setcookie( 'PHPSESSID', '', time() ); all that happens is that you get a new one. Is the real issue that when you go back to one.php your code unconditionally recreates the value? Regards Jeff PS madness is a state of mine. -Original Message- From: Miguel Loureiro [mailto:[EMAIL PROTECTED]] Sent: Friday, March 23, 2001 9:28 AM To: php-gen Subject: [PHP] Sorrysessions ... again...with code... |Hello all, I'm mad with mesorry but see if can understand why I'm mad. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]