note 41476 added to function.session-start
| From: | strozzino at email dot it | Date: | Sun, 11 Apr 2004 21:37:07 +0000 |
| Subject: | note 41476 added to function.session-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67995@lists.php.net to get a copy of this message | ||
When u make a redirection u'll lost the session id...to solve this try in this way:
//session_start()
session_start();
//get session_id
$id = session_id();
//get session_name
$name = session_name();
//merge
$_SESSION['session'] = "?" . $name . "=" . $id;
when u'll make a redirection like this
echo "<meta http-equiv='refresh' content='$seconds;url=$url'>";
in the $url variable u have to add the session before saved in $_SESSION['session'], like
this:
$session = $_SESSION['session'];
$url="./some_page.php" . $session;
$seconds = the seconds u want
echo "<meta http-equiv='refresh' content='$seconds;url=$url'>";
this will work good...but remeber to start the session also in the page of redirection.....
----
Manual Page -- http://www.php.net/manual/en/function.session-start.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41476
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41476&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41476&report=yes
Search -- http://master.php.net/manage/user-notes.php