note 44433 deleted from function.session-start by tomsommer

From: Date: Thu, 05 Aug 2004 16:43:23 +0000
Subject: note 44433 deleted from function.session-start by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-74026@lists.php.net to get a copy of this message
Note Submitter: mbalaga@o2.ie ---- I noticed something different, may help to someone struggling with session variables losts: sending an absolute location "http://..." to the header always caused loss of $_SESSION declarations unless... I used "Location: /destination" string without "http:". Giving "http:" even cleared the $_SESSION varsiable after jscript redirection(!). so instead of: <? session_start(); $_SESSION["START_POINT"] = $_SERVER["PHP_SELF"]; header("Location: http://".$_SERVER['HTTP_HOST']. dirname($_SERVER['PHP_SELF'])."/".$relative_url); ?> simply as this works: <? session_start(); $_SESSION["START_POINT"] = $_SERVER["PHP_SELF"]; header("Location: /".$relative_url); ?> have a fun!

« previous php.notes (#74026) next »