This one has me baffled.
Tonight, my site is dropping session variables when using internet explorer.
On every page, I have:
[code=php]session_start();
After entering appropriate login information and clicking login:
[code=php]session_regenerate_id();
$_SESSION[‘intID’] = $intID;
And on each page after login, I get the users id using:
[code=php]
function intIDFromSession() {
if (isset($_SESSION[‘intID’])) {
$intID = $_SESSION[‘intID’];
if (is_numeric($intID)) {
if ($intID > 0) {
return $intID;
}
}
}
return -1;
}
It seems, when the problem occurs, the problem is that
isset($_SESSION[‘intID’]) is returning false, thus intIDFromSession is return -1. session_id(); still returns the session id correctly.
The header contains the following:
[code=php]
header(“Expires: Mon, 26 Jul 1997 05:00:00 GMT”); // Date in the past
header(“Last-Modified: ” . gmdate(“D, d M Y H:i:s”) . ” GMT”); // always modified
header(“Cache-Control: no-store, no-cache, must-revalidate”); // HTTP/1.1
header(“Cache-Control: post-check=0, pre-check=0”, false);
header(“Pragma: no-cache”);
[list][*]
This worked yesterday. There hasn’t been any changes to the session / login code since then.
It still works locally AND on a test server. Both the test server and production server are hosted by Yahoo.
It works in Firefox, Opera and Safari.
It is only a probem TONIGHT and using INTERNET EXPLORER on the PRODUCTION server.
Any guesses?
By the way, this is a new website, so there are no users yet (besides me! using three test users). I’ve been using the production server for about a month without this issue. I haven’t tested IE on another machine.
If you’d like any more information, please let me know! Thanks.