[thelist] PHP losing session value

noah noah at tookish.net
Fri Jul 30 16:23:10 CDT 2004


I'm having some trouble with a small CMS that I built in PHP. It runs 
fine on my local Windows/Apache/PHP 4.2.3 setup. It ran fine on the 
client's old Linux/Apache/PHP 4.2.x setup.

The host, however, has recently upgraded to PHP 4.3.8, and now the value 
of the session variable keeps being lost. It usually happens at about 
the third new page visited after login.

The PHPSESSID is not lost, and the variable actually remains set, but 
the value is lost. I'm doing:

print($PHPSESSID);
print_r($_SESSION);

at the top of each page. On the first couple of pages I get, say:

195307c58df1baca6f43dfae0d789268
Array ( [id] => 10 )

On the third or so page I start getting:

195307c58df1baca6f43dfae0d789268
Array ( [id] => )

When I test $_SESSION['id'] it comes back true -- there's just no value.

This happens even when the third page is the same as the first (i.e., 
when I navigate back to the initial screen after login).

I've checked the session timeout, and it's set to an hour, so it's not 
that. I've also checked all of the other session-related variables in 
php.ini, and they're all identical to those in a PHP 4.2 php.ini that 
allows the script to run perfectly.

Any ideas?

Cheers,
Noah


More information about the thelist mailing list