Re: Sessions don't load
| From: | Andrey Hristov | Date: | Wed, 09 Jan 2002 14:22:00 +0000 |
| Subject: | Re: Sessions don't load | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79911@lists.php.net to get a copy of this message | ||
when session_start() is called for a first time, it generates session_id and set a cookie for the
browser. The common name for the
cookie is PHPSESSID. You receive it on the refresh, because after the first load this cookie is
known by the browser. When you hit
the page for a first time, there is no set PHPSESSID cookie, so PHP WILL NOT have
$GLOBALS['PHPSESSID'] variable (assuming
register_globals is on in php.ini).
If you want the id. Get it from session_id().
HTH
Regards,
Andrey Hristov
----- Original Message -----
From: "Ryan Kelley" <kelleyr@internetinvisions.com>
To: <php-general@lists.php.net>
Sent: Wednesday, January 09, 2002 4:02 PM
Subject: [PHP] Sessions don't load
> I have got a page that i am loading sessions on with the following code:
>
> session_start();
> $HTTP_SESSION_VARS['sess_id']=$PHPSESSID;
>
> Except that it will not assign an actual value until i hit refresh on my
> browser. Any ideas for a fix?
>
> Thanks in advance,
>
> Ryan Kelley
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>