Session persistence with the 'header("Location: ...") call

From: Date: Sun, 08 Oct 2000 18:59:35 +0000
Subject: Session persistence with the 'header("Location: ...") call
Groups: php.general 
Request: Send a blank email to php-general+get-19108@lists.php.net to get a copy of this message
Hi; I am having a problem with Sessions under php4. The problem seems to be apparent when I use the header() call to direct to another page. Simple Example; 1.php4 ===== <? session_start(); session_register("SESSION"); $SESSION["username"]="bill" header("Location:2.php4"); ?> 2.php4 ===== <? session_start(); if (isset ($SESSION)) { echo $SESSION[\"username\"]."<br>"; } ?> end example My problem is that '2.php4' does not have $SESSION available to it (ie: the username does not get printed out). Any help will be greatly appreciated... Chris

« previous php.general (#19108) next »