/    Sign up×
Community /Pin to ProfileBookmark

Suddenly dropping session on IE only, production server only

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(); [/code]

After entering appropriate login information and clicking login:

[code=php]session_regenerate_id();
$_SESSION[‘intID’] = $intID;[/code]

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;
}
[/code]

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”);
[/code]

[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.


  • [/list]

    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.

    to post a comment
    PHP

    3 Comments(s)

    Copy linkTweet thisAlerts:
    @k89mmkauthorMay 07.2011 — I gave up on this last night without finding a fix. And without making any changes, it worked first thing this morning.
    Copy linkTweet thisAlerts:
    @ryanlundMay 08.2011 — The session data itself is stored on your server in the file system. So technically if you are still able to retrieve the session id then assuming the file is still there....you should still be able to access the session data.

    What I don't understand is - why it would not work on IE as the data, as i said, is stored on the server and not affected by the browser at all. If i think of anything i will let you know, but personally i would have a dig around where you store your session data to see whats going on in more detail.
    Copy linkTweet thisAlerts:
    @DasherMay 08.2011 — $_SESSION['intID'] gets its value from $intID,

    and $intID gets its value from $_SESSION['intID'],

    I don't see where $intID gets initialized.
    ×

    Success!

    Help @k89mmk spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.28,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...