note 30265 deleted from ref.session by sniper
| From: | sniper@php.net | Date: | Mon, 06 Oct 2003 04:04:36 +0000 |
| Subject: | note 30265 deleted from ref.session by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57876@lists.php.net to get a copy of this message | ||
Note Submitter: Devin Emke
----
It appears that you cannot really mix and match the old and new ways of registering session
variables.
old:
register_globals = ON
$name = 'John Smith';
session_register ('name');
new:
register_globals = OFF
$_SESSION['name'] = 'John Smith';
with register_globals = ON any changes to a global variable will effect the $_SESSION array when the
session is reloaded:
<?
// register_globals = ON
session_start ();
$_SESSION['test'] = 'this is a test';
$test = strtoupper ($test);
print_r ($_SESSION);
?>
When this script is run and then refreshed (reload the session) $_SESSION['test'] will
equal 'THIS IS A TEST'