Since I am using the FF browser, I have not found any problems. Last week submitted to the user to see, said that the use of IE login after the invalid, big surprise. The result is really like this. It's embarrassing.
The login code is as follows:
Copy Code code as follows:
Whether a session exists from the server query
J.ajax ({
Type: "Get",
URL: "Sessioncheck.asp",
Data: "",
timeout:1000,
Error:function () {
Alert (' Sorry, server is busy now! ');
},
Success:function (Comments_data) {
if (Comments_data = = 1) {
El.createdialog (opts);
J.startover ();
}
else{
var sql = Selectsql (searchkey,stype);
window.location.href = SQL;
}
}
});
Roughly so sessioncheck.asp inside is to check the session, the code is as follows:
Copy Code code as follows:
If session ("username") = "" Then
Response.Write ("1")
Else
Response.Write ("2")
End If
The result is to use IE this session ("username") anyway no, timeout set up also useless.
Go online to check for a long time, found that the same problem is quite a lot, finally find out the reason: caching problem.
When an asynchronous get gets fetched, if the URL is unchanged, it is the information in the cache that is being invoked directly, and then it causes the value to not be in the session.
Solution that's easy, Google "asp clear cache" a lot.
Finally, a paragraph was added to the sessioncheck.asp, as follows:
Copy Code code as follows:
Response.Buffer =true
Response.ExpiresAbsolute =now ()-1
Response.expires=0
Response.cachecontrol= "No-cache"
If session ("username") = "" Then
Response.Write ("1")
Else
Response.Write ("2")
End If