How can I share session registered variables between different processes?
Here is my problem:
File 1:
-----------------------------------------------------------------------
<?php
session_start();
$var1="This should";
$var2="be displayed";
$_SESSION[ 'var1' ]=$var1;
$_SESSION[ 'var2' ]=$var2;
if (session_is_registered('var1')) {
print "Var1 is registered<br>";
}
if (session_is_registered('var2')) {
print "Var2 is registered<br>";
}
print "<A HREF=/work/test2.php>Second File</A>";
?>
File 2:
-----------------------------------------------------------------------
<?php
if (session_is_registered('var1')) {
print "test2:Var1 is registered<br>";
}
if (session_is_registered('var2')) {
print "test2:Var2 is registered<br>";
}
$var1=$_SESSION[ 'var1' ];
$var2=$_SESSION[ 'var2' ];
print "$var1 $var2 <br>";
?>
In file test2.php neither variable is reported as a session registered
variable and nothing is displayed. File /tmp/sess* has the correct
contents:
var1|s:11:"This should";var2|s:12:"be displayed";
How can I establish real global variables, ones which will
be visible in both files? I thought that httpd was supposed
to read the sessxxxxx file, depending on the cookie received from
the browser and establish those global variables.
I apologize if it is a beginer question, but I was unable to
answer it either through the O'Reilly book or PHP online literature.
I'm at the verge of re-installing PHP 4.3.36 with shmop module enabled.
--
Trust me, I know what I'm doing. (Sledge Hammer)