Re: SESSION SID Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: <dpgirago@mdanderson.org>
> Can someone explain to me the mechanism by which SID acquires a value?
>
> For example,
>
> $FOO = SID;
> echo $FOO;
>
> produces something like "PHPSESSID=ade4055eef947f1a00cdb280470e859b" when
> IE is first opened and the page is loaded,
> whereas reloading of the page produces an empty string when $FOO is
> echo'd. Seems to have something to do with creating a
> browser instance.

SID is used to pass the session ID around in URLs. It gives you the text
formatted so that you can just stick it into a URL.

Normally cookies are used to hold the session id and pass it from page to
page. If for some reason PHP cannot set the session cookie (or it's not
present), then PHP creates SID.

This means you can include SID in all of your URLs and when the cookie is
there, it'll be empty and nothing will appear in your URL (rightly so), but
if the cookie is not there, SID will place the session ID in your URL so
that your sessions persist.

---John Holmes...

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux