Re: trouble with reading session variables: BUG?
| From: | Richard Lynch | Date: | Sun, 04 Feb 2001 01:01:18 +0000 |
| Subject: | Re: trouble with reading session variables: BUG? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-38034@lists.php.net to get a copy of this message | ||
> When using Cookies for session management everything works fine (the
> authentication part). But not passing the values of the session variables.
> In the example below the existence of '$ident' is verified. But no chance
to
> get its value: no 'echo' prints out anything! Even isset() denies the
> existence of $HTTP_COOKIE_VARS['ident'].
>
> -- example ------------------------------
>
> session_start();
> if (!session_is_registered('ident')) {
> header ("Location: ../index.php");
> }
> // trying to retrieve $ident which is obviously known to the session
> echo $ident;
> echo $HTTP_COOKIE_VARS['ident'];
> echo $HTTP_SESSION_VARS['ident'];
Registering a variable does not store that variable in a cookie.
Only the users's "session" ID is stored in a cookie.
ident could easily be registered, but be set to ''
We'd need to see ../index.php to have any idea what you've stored in $ident.