Why does $_SESSION['count'] = $count?
Posted: Wed Sep 25, 2002 10:45 am
I'm forced into using version 4.1.2. Something to do with the new Apache not liking some kind of SSL or something.
Anyway, I've narrowed down a problem to a bit of sample code below. The system is thinking that $_SESSION['count'] and $count are the same variable. The sample code is the entire code file I am running and getting this peculiarity.
I don't understand. I thought $SESSION was an entirely separate array variable isolated from other variables but when I execute this code the two variables keep incrementing together except the first time when one is 0 and one is undefined.
This did not happen on another server I was using a few months ago.
Is this a setting in php.ini or can anyone help explain
session_name("Test");
session_start();
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
} else {
$_SESSION['count']++;
}
echo($_SESSION['count']);
echo($count);
Anyway, I've narrowed down a problem to a bit of sample code below. The system is thinking that $_SESSION['count'] and $count are the same variable. The sample code is the entire code file I am running and getting this peculiarity.
I don't understand. I thought $SESSION was an entirely separate array variable isolated from other variables but when I execute this code the two variables keep incrementing together except the first time when one is 0 and one is undefined.
This did not happen on another server I was using a few months ago.
Is this a setting in php.ini or can anyone help explain
session_name("Test");
session_start();
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
} else {
$_SESSION['count']++;
}
echo($_SESSION['count']);
echo($count);