Ok - just upgraded to PHP 4.2.2 and now it seems that sessions aren't working... I wrote some very basic code to test sessions and it fails...
Here is cookie1:
<?php
session_start();
session_register("val");
$val = "session variable, whoo hoo";
echo '<a href="cookie2.php">go to 2</a>';
?>
And here is cookie2:
<?php
session_start();
if (session_is_registered('val')) {
echo '$val is registered!<hr>';
} else {
echo '$val is NOT registered<hr>';
}
echo "here is the session variable: ".$val;
if (!strlen($val)) echo "no strlen on val.";
echo "<br><br>";
echo "session ID is ".session_id();
?>
When I run this code, cookie1 runs without error and I click the link for cookie2. But when I get there, it says $val is registered BUT there is nothing in $val. strlen($val) == 0. What really sucks, though, is that the variable $val IS registered-- I can find the sess_{session_id()} file in my /tmp directory with my variable inside.
Do I have a flawed PHP install? Or am I missing something so fundimental that it's staring me right in the face?
thank you,
Eric