Re: this code unsets $_SESSION['editor'] but doesn't touch any other session variables
| From: | John W. Holmes | Date: | Sun, 07 Sep 2003 17:42:21 +0000 |
| Subject: | Re: this code unsets $_SESSION['editor'] but doesn't touch any other session variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161917@lists.php.net to get a copy of this message | ||
anders thoresson wrote:
Hi, I've had troubles with an application that randomly (until now) unsets the session variable $_SESSION['editor']. I've hunted through all my code and finally managed to rule out everything else than the following couple of lines. It unsets the session variable $_SESSION['editor'], but leaving others, like $_SESSION['admin'] untouched. At the first debug, I get "Admin: Y Editor: Y" printed (which is the way I suppose things to be), but at the second debug I just get "Admin: Y Editor:".[snip]
You more than likely have register globals ON, so by setting $editor to some value above, you are also changing the value of $_SESSION['editor']. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals - www.phparch.comwhile ($editor = mysql_fetch_row($editorresult))[snip]