note 71535 added to ref.session

From: Date: Mon, 04 Dec 2006 20:59:44 +0000
Subject: note 71535 added to ref.session
Groups: php.notes 
Request: Send a blank email to php-notes+get-120281@lists.php.net to get a copy of this message
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']. ---- Server IP: 216.194.113.175 Probable Submitter: 66.24.233.2 ---- Manual Page -- http://www.php.net/manual/en/ref.session.php Edit -- https://master.php.net/note/edit/71535 Del: integrated -- https://master.php.net/note/delete/71535/integrated Del: useless -- https://master.php.net/note/delete/71535/useless Del: bad code -- https://master.php.net/note/delete/71535/bad+code Del: spam -- https://master.php.net/note/delete/71535/spam Del: non-english -- https://master.php.net/note/delete/71535/non-english Del: in docs -- https://master.php.net/note/delete/71535/in+docs Del: other reasons-- https://master.php.net/note/delete/71535 Reject -- https://master.php.net/note/reject/71535 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#120281) next »