|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2006-02-11 11:22 UTC] tony2001@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 21:00:02 2025 UTC | 
Description: ------------ I am assigning a session var $_SESSION['name'] and then assign a local var $name, which overwrites the first session var when I reload the page. NOTE: this bug only occours when reloading the page. It seams, that PHP has a reference $name = $_SESSION['name'] saved, the second time this script is executed. Am I missing anything?? Reproduce code: --------------- $_SESSION['name']=array("One","Two"); echo "Session 1:\n"; var_dump($_SESSION['name']); // the following line also changes $_SESSION['name'] // when the session was already set bevore (on reload) $name = array(); echo "Session 2:\n"; var_dump($_SESSION['name']); Expected result: ---------------- Session 1: array(2) { [0]=> string(3) "One" [1]=> string(3) "Two" } Session 2: array(2) { [0]=> string(3) "One" [1]=> string(3) "Two" } /* the above result is displayed the first time, but when I reload the page... */ Actual result: -------------- Session 1: array(2) { [0]=> string(3) "One" [1]=> string(3) "Two" } Session 2: array(0) { } /* on reload, the above output is given */