Re: session var being lost between pages
| From: | Papp Gyozo | Date: | Tue, 02 Oct 2001 10:00:53 +0000 |
| Subject: | Re: session var being lost between pages | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-69562@lists.php.net to get a copy of this message | ||
He meant that session_start() needs to be invoked on each page.
If you miss it on any page, then PHP assumes that this page does not use
sessions.
track_vars is a configuration directive in PHP.ini
(http://www.php.net/manual/en/configuration.php) this is set to true after
PHP4.0.3
I assume that he thought of register_globals: (from PHP manual)
register_globals
Tells whether or not to register the EGPCS (Environment, GET, POST,
Cookie,Server) variables as global variables. You may want to turn this
off if you don't want to clutter your scripts' global scope with user
data. This makes the most sense when coupled with track_vars - in which
case you can access all of the EGPCS variables through the
$HTTP_ENV_VARS,$HTTP_GET_VARS,$HTTP_POST_VARS, $HTTP_COOKIE_VARS,
and $HTTP_SERVER_VARS arrays in the global scope.
and additionally your original problem:
session_register() registers the _global_(!) variable named by it with
the current session.
session_start() needs no argument.
hth,
Papp Gyozo
- pgerzson@freestart.hu
----- Original Message -----
From: "Jean-Christian Imbeault" <jean_christian@hotmail.com>
To: <cdechery@easynet.com.br>; <php-general@lists.php.net>
Sent: Tuesday, October 02, 2001 4:44 AM
Subject: Re: [PHP] session var being lost between pages
> Can someone explain this to me? I am not very confused after reading this
> post ...
>
> >are you sure you have session_start() on all three pages and you have
> >enabled 'track_vars'???
>
> I have done no such thing. The PHP book I have doesn't mention any of
this.
> It simply says that using session_start() and session_register() will
cause
> the vars to be kept between pages. Are you sure what you are sayign is
true?
>
> If so please help me understand because I never saw any methion of what
you
> say must be done in any book or on PHP ML etc ...
>
> Thanks!
>
> Jc
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp
>
>
> --
> 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
>