note 44433 added to function.session-start
| From: | mbalaga at o2 dot ie | Date: | Thu, 05 Aug 2004 16:07:45 +0000 |
| Subject: | note 44433 added to function.session-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-74024@lists.php.net to get a copy of this message | ||
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!
----
Manual Page -- http://www.php.net/manual/en/function.session-start.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44433
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44433&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44433&report=yes
Search -- http://master.php.net/manage/user-notes.php