Sessions nightmare continue...

From: Date: Tue, 17 Aug 2004 09:46:56 +0000
Subject: Sessions nightmare continue...
Groups: php.general 
Request: Send a blank email to php-general+get-194032@lists.php.net to get a copy of this message
Hi all, Still no luck with sessions. I have installed an older version: 4.3.1 and have register_globals=Off I have 2 test pages a1.php and a2.php All I want to do is register a session variable, set a value for it and then in a2.php check that it is still registered and view the session's value. a1.php: <? session_start(); header("Cache-control: private"); // IE 6 Fix. if(isset($_POST['Submit'])) { $_SESSION["login"]="inside"; session_write_close(); header("Location: a2.php"); exit(); } ?> I can successfully register the session variable and set the value of it on page a1.php but when I go to page a2.php the session variable is not set and the value isnt set either. a2.php: <? session_start(); header("Cache-control: private"); // IE 6 Fix. if(!isset($_SESSION["login"])) echo("<br>session variable NOT set"); else echo("<br>session variable set"); echo("<br>session ID: " . session_id()); echo("<br>session value: " . $_SESSION["login"]); ?> I have been trying to get this to work for ages with no luck. I have been reading the manual and have googled and cant seem to find the problem. if anyone can help that would be great. thanks in advance Angelo -------------------------------------------------------------------- Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

« previous php.general (#194032) next »