note 4359 deleted from Session handling functions by sas

From: Date: Thu, 17 Aug 2000 21:25:09 +0000
Subject: note 4359 deleted from Session handling functions by sas
Groups: php.notes 
Request: Send a blank email to php-notes+get-2244@lists.php.net to get a copy of this message
This snippet from my code may shed some light on the gpc_globals issue mentioned by rturk above on 19th Dec 1999. I have used COOKIE vars but it would work just as well for GET vars. Hope it helps. // SESSION GLOBALS WORKAROUND (this deserves some explanation) // // PHP session management is wonderful except, at present, it is necesssary // to have gpc_globals enabled in php.ini in order for the session management // to pick up the session id from the HTTP request. // // This seems to be to allow PHP to be flexible in allowing sites to fall back // to using GET variables to propagate the session ID (if --enable-trans-sid // is configured). To achieve this it seems to rely on the session ID variable // name being defined in the global space using the default HTTP request // variable definition override sequence. // // By defining the session ID variable yourself you can have session // management WITHOUT GPC globals! if ((session_name() != "") && isset ($HTTP_COOKIE_VARS[session_name()])) { ${session_name()} = $HTTP_COOKIE_VARS[session_name()]; }

« previous php.notes (#2244) next »