note 82128 deleted from ref.session by danbrown

From: Date: Sun, 20 Jul 2008 16:32:19 +0000
Subject: note 82128 deleted from ref.session by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142180@lists.php.net to get a copy of this message
Note Submitter: awe ---- The note below from 04-Dec-2006 09:59 about lost session information is still valid! I have just moved hosting and have this bug which previously didn't affect my site. PHP version 5.2.4. What I've found out is that inside a local function this bug doesn't happen (probably due to variable scope). So this is BUGGY (session variable content will be lost): <?php $myVar = 1234; $_SESSION['myVar'] = $myVar; ?> But this would work: <?php function foo(){ $myVar = 1234; $_SESSION['myVar'] = $myVar; } foo(); ?>

« previous php.notes (#142180) next »