I have a site that i am using session variables. up until last Wednesday this was working fine but now is sporadically working. Sometimes I can retreive the session vars and sometimes i cant. What could be going on and how can i trouble shoot this with my hosting company if its a server issue?
I have this page for testing setting sessions which works all the time no problem and session cookie domain is always blank:
<?
session_start();
$_SESSION['ID'] = "112233";
$_SESSION['token'] = "mytoken";
print "Created Session ID: ".$_SESSION['ID']."<br>";
print "Created Session Token: ".$_SESSION['token']."<br>";
print "Session Cookie Domain If Set: ".ini_get('session.cookie_domain')."<br><br>";
?>
<a href="info2.php">Click To See If Sessions Are Passing</a>
Then i click through to this page to see if sessions are passing or not. This is the page that sometimes shows the sessions i set in the above code and sometimes doesnt. session cookie domain has always been blank on this page as well:
<?
session_start();
print "Passed Session ID: ".$_SESSION['ID']."<br>";
print "Passed Session Token: ".$_SESSION['token']."<br>";
print "Session Cookie Domain If Set: ".ini_get('session.cookie_domain')."<br><br>";
?>
If session ID doesnt say "112233" and session token doesnt say "mytoken" then there is a problem.<br /><br />
<a href="info.php">Go Back To Set Session Variables</a>
These two pages are on HTTPS i dont know if that info is relevent or not but i thought i would mention it. I dont think it browser related cause when its not working i have loaded these pages in windows ie 8 and google chrome and on a mac safari, firefox and google chrome with the same results.
Any thoughts would be greatly appreciated. Is there anything in phpinfo() i could look at when things are working or not working that may help resolve this? This is driving me nuts because like i said it works sometimes and sometimes it doesnt.
This was a server error somewhere. The hosting provider had to change something. After that everthing worked fine.
Thanks for all the help and input
精彩评论