Because I use the ff browser, I have never found any problems. When I submitted it to the user last week, I was surprised that it was invalid after I used IE to log on. The result is true .. Very stable
The logon code is as follows:
Copy codeThe Code is as follows: // query whether a session exists on the slave server
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;
}
}
});
In general, sessioncheck. asp is nothing more than querying sessions. The Code is as follows:Copy codeThe Code is as follows: if session ("username") = "" then
Response. Write ("1 ")
Else
Response. Write ("2 ")
End if
The result is that the session IE ("username") is useless, and the timeout setting is useless.
I went online for half a day and found that there were quite a few problems. Finally, I found the cause: the cache problem.
When an asynchronous get is obtained, if the url remains unchanged, the information in the cache is directly called, and the value in the session is never obtained.
The solution is simple. There are a lot of google "asp clear cache.
Finally, add a section in sessioncheck. asp, as shown below:Copy codeThe Code is 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