php database session handling in IE8

2019-07-26 20:56发布

问题:

I've got an html page from where Im making this call periodically:

function logon(id)
{
 $.get("data.php", { action: 'online', userID: id}, function(data){
  $("#msg").html(data);
 });
}

What this does is it calls this SQL script in data.php:

$sql = "update user_sessions set expires=(expires + 2) where userID = $userID";
mysql_query($sql, $conn) or die(mysql_error());
echo $sql;

I can see by the echo that the sql syntax and values are correct, but THE CHANGES TO THE expires FIELD ARE NOT DONE, ONLY IN IE8!! It works fine in other ff, safari, chrome, ie6 and 7.

There is nothing browser specific about making this sql call, but the user_sessions table is used to store PHP's sessions. Im only increasing the session expiry time when the call is made. What in IE8's session handling is preventing the session time from changing? Is there any caching or cookie problem that needs to be changed?

回答1:

Use .post to ensure caching isn't fouling things up.



回答2:

Download and install Fiddler to make sure the Ajax call is sent to the server. There might be some kind of ie8 JavaScript incompatibility that is preventing the Ajax from firing?.