Re: Another Session Question

From: Date: Wed, 31 Dec 2003 18:01:54 +0000
Subject: Re: Another Session Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-173563@lists.php.net to get a copy of this message
Your'e right, that's a typo. If I put a echo $_SESSION['counter_file'] . ' testxxxxxxxxx ' . $counterFile; Before and after the conditional, $_SESSION['counter_file'] is set after the conditional, as it should be. But, it is gone from the before echo when the function is recalled. The Session buffer looses the value. session_start() is called again before returning to the function; but, I thought repeated session_starts() were ignored and thus should not restart the session.
I use the session buffer extensively in other places without any problem.    
Matt Matijevich wrote:
[snip]
session_start();                               
   if($_SESSION['counter_file'] !==$counterFile)        //See if visitor has already been counted for this page
   {$num += 1;                              $_SESSION['counter_file'] = $counterFile;
} echo $_SESSION['counterFile'] . ' testxxxxxxxxx ' . $counterFile; [/snip] might just be a typeo but do you mean: echo $_SESSION['counter_file'] . ' testxxxxxxxxx ' . $counterFile; instead of this: echo $_SESSION['counterFile'] . ' testxxxxxxxxx ' . $counterFile; ?


« previous php.general (#173563) next »