note 51858 added to faq.misc
| From: | php at REMOVEMEkennel17 dot co dot uk | Date: | Wed, 13 Apr 2005 03:22:44 +0000 |
| Subject: | note 51858 added to faq.misc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87928@lists.php.net to get a copy of this message | ||
Regarding simulating register_globals = off, note that it is impossible to adequately prevent
$_SESSION variables from being globalised, as the array (and thus the globals) are created on a call
to session_start(). You would therefore have to 'undo' this when you start a session as
using it at the start of your script will have no effect.
To avoid potential problems, use a prefix that is unique for all session variables (e.g.
'SESS_'), and only access them via the $_SESSION array. The prefix ensures that you
don't have a naming clash (and therefore a security risk) with any non-session globals.
----
Manual Page -- http://www.php.net/manual/en/faq.misc.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51858
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51858&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51858&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51858&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51858&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51858&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51858&report=yes
Search -- http://master.php.net/manage/user-notes.php