note 19716 added to ref.session
| From: | ericnielsen at mediaone dot net | Date: | Fri, 08 Mar 2002 17:48:37 +0000 |
| Subject: | note 19716 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27517@lists.php.net to get a copy of this message | ||
Here's one useful function to consider (still using the old style HTTP_ arrays). This is
useful because the GET-based session fallback mode doesn't append session ids to header calls.
However, you might want to maintain your session ids across local redirects.
<pre>
function localRedirect("url")
{
GLOBAL $HTTP_COOKIE_VARS;
if (isset($HTTP_COOKIE_VAR["PHPSESSID"]))
header("Location: $url");
else
header("Location: $url" ."?" . SID);
}
This allows a much cleaner fallback when the cookie was rejected by the user. The only thing
remaining that is non-transparent is that I can't seem to get the "Accept Cookie"
dialog to not pop up on every succeeding page if the user declines the first one.
--
http://www.php.net/manual/en/ref.session.php
http://master.php.net/manage/user-notes.php?action=edit+19716
http://master.php.net/manage/user-notes.php?action=delete+19716
http://master.php.net/manage/user-notes.php?action=reject+19716