Re: session data missing
| From: | ulf sundin | Date: | Thu, 10 Jul 2003 01:28:28 +0000 |
| Subject: | Re: session data missing | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154657@lists.php.net to get a copy of this message | ||
ok. now I get it. first set the session-variables like any other:
$foo = 'bar';
then register them in the sessionfile:
session_register('foo');
that makes sense. But it's not at all what the manual says. I guess my php
version has passed its expiration date.
thanks for the help, anyway. It seems to be working the way I wanted it to.
Regards
Ulf
"Kevin Stone" <kevin@helpelf.com> skrev i meddelandet
news:00e301c34650$88da1ef0$6500a8c0@kevin...
>
> ----- Original Message -----
> From: "ulf sundin" <majikthse@spray.se>
> To: <php-general@lists.php.net>
> Sent: Wednesday, July 09, 2003 1:00 PM
> Subject: Re: [PHP] session data missing
>
>
> > ok, so now the variable names are registred and stored in the file. But
> > without values.
> > check this:
> >
> > --firstpage.php----
> > session_start()
> > session_register('foo');
> > $HTTP_SESSION_VARS['foo'] = 'bar';
> > echo $HTTP_SESSION_VARS['foo']; //outputs bar;
> >
> > transport by a href to:
> > ----secondpage.php----
> > session_start();
> > echo $HTTP_SESSION_VARS['foo']; //outputs nothing
> >
> > ---
> > checking the contents of the file called /tmp/sess_{session_id}:
> > !foo|
> (snip)
>
>
> Make a choice here..
>
> => session_register('foo');
> => $HTTP_SESSION_VARS['foo'] = 'bar';
>
> Use either the session_register() function or the session global array.
Not
> both.
>
> - Kevin
>
>