Re: PHPSESSID AND SID

From: Date: Wed, 30 Jul 2003 22:02:38 +0000
Subject: Re: PHPSESSID AND SID
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-157609@lists.php.net to get a copy of this message
phpsessid is the default name of the session cookie sent from the browser to PHP. So it becomes part of the $_COOKIE array, which PHP automatically turns into a global variable for you. Therefore I use $_COOKIE['phpsessid'] to retrieve it. But often I use session_name() to replace phpsessid with a more descriptive name. In that case, the key in the cookie collection is changed accordingly. So it seems there's nothing special about phpsessid other than it being the default cookie name. ----- Original Message ----- From: "Daryl Meese" <darylm@magiasoftware.com> To: <php-general@lists.php.net> Sent: Wednesday, July 30, 2003 12:59 PM Subject: [PHP] PHPSESSID AND SID > This should be a simple question but I can't find the answer in the manual. > > is it necessary to global variables or constants in functions? > i.e. > function Foo() > { > global $PHPSESSID; > global SID; // how would you do that anyway? > } > > Thanks in advance > > Daryl > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#157609) next »