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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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
>
>






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to