I use the $_SESSION buffer extensively on my site without a problem, except one.
Maybe someone can help me understand the problem.


I have a simple page counter with a test to see if the page has been counted for the user.

start_session();
*
* [additional code]
*
if($_SESSION['ctr_file']!==$counterFile) //See if visitor has already been counted for this page
{$num = $num+1; $_SESSION['ctr_file'] = $counterFile; //set/reset counter file for next time


Pages that use the counter function all have a start_session(); and a call to the counter function,

Everything works fine, except when I include another script file that also uses the $_SESSION buffer.

What appears to be happening is that start_session() on the second script reinitializes the session buffer and I lose the data from the first session.

Yet, as I read php manual, it seems to say that start_session is suppose to simply restore the variables for the page it is on; not start a new session.

many thanks....

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to