if you have register globals off, then use the $_SESSION array.

// set the value of a session var:
$_SESSION['foo'] = "bah";

// test to see if a session var is set
if(isset($_SESSION['foo'])) { ... }

// unset / unregister a session var

The older functions still work, but are not reliable, according to the

I much prefer working with $_SESSION, because session_register() was a
little counter-intuitive (IMO), and now doesn't work like the rest of the
superglobal arrays ($_POST, $_GET, etc).

If you have register globals off, I recommend working the new way.

Justin French

on 24/09/02 6:37 PM, Giancarlo Pinerolo ([EMAIL PROTECTED]) wrote:

> The manual has many cautions that say 'do not use session_regiister,,
> session_is_registered, session_unregister, when the ini setting is
> register_globals=off.
> But they still do work, it seems.
> Or how exactly  do these function work differently than with reg_globals
> On?
> Can I still continue to use them with reg_globals=off, as they seem to
> work anyway?
> Gian

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to