Hello,
I'm building a property site, I've coded several other systems in the past before using sessions without an issue. I find this to be extremely strange.
I went to bed and everything was working, login/logout, etc. I woke up in the morning and nothing worked anymore.
Currently I cannot get a session to save information and pass it onto the next page. I created 2 test scripts, test1.php and test2.php. Test1 will set a session variable, Test2 will attempt to read that session variable.
test1.php
<?
session_start();
echo "setting session variable agent_user as testing<BR><BR>";
$_SESSION['agent_user'] = "testing";
echo "<a href=\"./test2.php\">test2</a>";
?>
test2.php
<?
session_start();
echo "Reading session variable<BR><BR>";
$agentuser = $_SESSION['agent_user'];
echo "session variable agent_user is now set as $agentuser<BR><BR>";
echo "<a href=\"./test1.php\">test1</a>";
?>
You can now see these 2 very simple scripts in action at the URL below.
http://www.philippine-properties.com.ph/agents/test1.php
...
So far I've spent about 6 hours on this problem with no end in sight.
I'm currently running php 5.1.6.
My config file session settings are as follows:
session.save_path = "/var/lib/php/session"
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 43200
session.cookie_path = /tmp/
session.cookie_domain = www.philippine-properties.com.ph
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 43200
session.bug_compat_42 = 0
session.bug_compat_warn = 1
session.referer_check = philippine-properties
session.entropy_length = 0
session.entropy_length = 32
session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 480
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
I was using the base defaults that came with plesk 8.x.x, but I started toying around with the settings after everything broke to no avail.
I checked out the php sessions directory where it stores the session information in file format, I can see the session created and see that the file contains the information from the session I attempted to create/read from.
Seems to me it may be a client issue or an issue where the server cant figure out what the sessionid for a client is. (maybe a little goblin came and used my computer while i was asleep, or my cat walked across the keyboard). I checked all of my client settings for cookies, cleared everything out, tried and tried again to no avail.
Any help with this would be greatly appreciated. My system is a VPS running a base fedora core 6 install with most everything yum'd in. I do have the php 5.2.3 source code on hand and was going to recompile if I couldnt figure out anything soon.
Thank you in advance.