RE: [PHP] [Session]
| From: | Johnson, Kirk | Date: | Tue, 26 Mar 2002 23:05:53 +0000 |
| Subject: | RE: [PHP] [Session] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90285@lists.php.net to get a copy of this message | ||
> I am probably wrong about this, but I thought that you could register
> session variables using this technique only if you are using
> PHP 4.1.x
> and you use the format:
>
> $_SESSION['v_s'] = 500;
The key point is the register_globals setting in php.ini. If it is set to
on, then register variables this way, regardless of the version:
$v_s = 500;
session_register{'v_s');
If it is set to off, then do as above, assuming your version is new enough
to support the new array $_SESSION[]:
$_SESSION['v_s'] = 500;
The array $_SESSION[] is pretty new, maybe 4.1.2? Even with this new array,
you can still use the old method for registering variables. Also, in a
recent release, or else coming up shortly, the default setting for
register_globals will be changed from "on" to "off".
Kirk