note 23957 deleted from ref.session by dams

From: Date: Sat, 03 Aug 2002 03:08:21 +0000
Subject: note 23957 deleted from ref.session by dams
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-34193@lists.php.net to get a copy of this message
@ericnielsen's comment from 08-Mar-02 To append session ids to local header calls when using GET-based session fallback mode (PHP does not automatically) I do the following using a relative path and the SID constant: function localRedirect($relPath) { $url = "http://".$_SERVER['HTTP_HOST']. dirname($_SERVER['PHP_SELF'])."/".$relPath; if (defined("SID") && SID != "") { $url .= "&".SID; } header("Location: ".$url); exit; } In this way the session ids are maintained across local redirects without getting any "Accept Cookie" dialogs to pop up on every page. I check the constant SID instead of Cookie-Params, because SID is only defined (automatically by PHP), if the client did not send the appropriate cookie. Regards Rainer Kuhn

« previous php.notes (#34193) next »