note 71535 deleted from ref.session by danbrown
| From: | danbrown@php.net | Date: | Sun, 20 Jul 2008 16:46:32 +0000 |
| Subject: | note 71535 deleted from ref.session by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142198@lists.php.net to get a copy of this message | ||
Note Submitter: aserboni at gmail dot com
----
The session variable is still lost when navigating even if I change $setting or
$_SESSION['setting'].
If you assign a session subscript/key to the same name as a variable, the session variable will be
volatile and lost upon navigating.
For example, if passing a setting that you want in $_SESSION, don't do this:
<?
$setting = $_REQUEST['setting'];
if (!empty($setting))
$_SESSION['setting'] = $setting;
?>
Instead, rename $setting or $_SESSION['setting'].