> * Thus wrote Rich Gray ([EMAIL PROTECTED]): > > So your telling me that all variables defined in the global scope are > > automatically added to the $_SESSION array...? > > Not true I think.... > > > > no. read the documentation, in full.
you're right - I'm sorry I hadn't read it in full... > > The soluction to your problem was resolved from the first reply (by > Chris Shiflett), but you rejected it because of it not making sense > to you, which seems to be the problem. Yes, however I was simply asking Chris to explain to me more as it didn't make sense to me (because I hadn't read the manual fully). I mistakenly expected the $_SESSION array to hold copies of assigned data not references to the global namespace variable ... my expectations were based on PHP's current default behaviour of pass by copy rather than by reference. It seems with globals on it can become a minefield eg below where a script happens to define and use a variable with the same name as an entry in the $_SESSION array... <? // script_a.php - developed by dev A session_start(); $_SESSION['test'] = 'dev A saves some data'; header('Location : script_b.php'); ?> <? // script_b.php - developed by dev B session_start(); $test = 'I am another variable in the global scope that happens to have the same name as a $_SESSION array entry'; print_r($_SESSION); // dev B has just trashed dev A's saved data... ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php