I've been using PHP sessions for some time on a public web server.
Recently I installed Redhat 9 / Apache and PHP on a local PC [on my LAN].
PHP 4.3.6 [from terminal > php --version]
PHP 4.2.2 [from Apache via phpinfo() test page]
Apache 2.0.40
With this test session code:
If I load up the page and enter "blah" and submit, it will store into the /tmp/sess* file this:
But it will never update it from there, the count remains 1 etc. I can delete the file, or destroy the session and then it will store the new posted data.
any help would be grealy appreciated. pointers or suggested reading is fine too
Recently I installed Redhat 9 / Apache and PHP on a local PC [on my LAN].
PHP 4.3.6 [from terminal > php --version]
PHP 4.2.2 [from Apache via phpinfo() test page]
Apache 2.0.40
With this test session code:
Code:
<?
session_start();
if(isset($HTTP_POST_VARS['inputName']))
{
$Name=$HTTP_POST_VARS['inputName'];
}
$nameIs=0;
if($_SESSION["Name"]){$nameIs+=1;}
if($HTTP_SESSION_VARS["Name"]){$nameIs+=4;}
$Count++;
session_register("Name");
session_register("Count");
?>
<html>
<body>
<?
$SID=session_id();
echo "session name: ".session_name()."<BR>\n";
echo "session id: ".session_id()."<BR>\n";
echo "session module name: ".session_module_name()."<BR>\n";
echo "session save path: ".session_save_path()."<BR>\n";
echo "encoded session: ".session_encode()."<BR>\n";
if($Name!=""){echo "Hello $Name<BR>";}
echo "You [ $Name ] have been here $Count times.<BR>\n";
echo "<form action='$SCRIPT_NAME?".$SID."' METHOD=POST>";
echo "<input name='inputName' value='$sess_name'><BR>";
echo "<input type=submit>";
echo "<a href='$SCRIPT_NAME?".$SID."'>Reload Page</a>";
?>
<HR>
NameIs=<?=$nameIs;?>
If I load up the page and enter "blah" and submit, it will store into the /tmp/sess* file this:
Name|s:4:"blah";Count|i:1;
But it will never update it from there, the count remains 1 etc. I can delete the file, or destroy the session and then it will store the new posted data.
any help would be grealy appreciated. pointers or suggested reading is fine too
Session data from phpinfo() said:session
Session Support enabled
Directive Local Value Master Value
session.auto_start
On On
session.cache_expire
180 180
session.cache_limiter
nocache nocache
session.cookie_domain
no value no value
session.cookie_lifetime
0 0
session.cookie_path
/ /
session.cookie_secure
Off Off
session.entropy_file
no value no value
session.entropy_length
0 0
session.gc_maxlifetime
1440 1440
session.gc_probability
1 1
session.name
PHPSESSID PHPSESSID
session.referer_check
no value no value
session.save_handler
files files
session.save_path
/tmp /tmp
session.serialize_handler
php php
session.use_cookies
On On
session.use_trans_sid
1 1