I had real problems with IE 8 recently. What I do in my jquery script is I do a "Get" request to my server to look at the users cookie and determine if they wanted to stay logged in for 30mins or stay logged in for 2 weeks. I then return that amount in milliseconds back.
This is what I came up with
So I did this in the document rdy part and it would go and find there time and set it as a timeout. Every time they make an ajax request it would clear this timeout and make a new timeout. Now in firefox it works as it should work.
However in IE8 it does not work as it should.
I let my timer time out and it redirected to me to my sign in page. I tried to log in and I was timed out immediately. It is like it stores everything in it cache and once you where timed out once your timed out forever until you clear the cache or close IE 8 up and restart.
So I did some tests
So I logged in and out in IE8 and noted what the time that was being return in the wait variable.
Every single time I did this I got the same number back.
I did the same thing in firefox and got
Every time I logged in I got a different number.
So I made another test using asp.net mvc as the server but you could easily use php if needed. All it has on the server side is a random generator. When I run this code in IE 8 I get the same random number each time when I run it in firefox I get a different number each time(well sometime get the same number but that because it is random).
// View(only has the script files)
So I figured out that if I wrote my jquery like this
and set cache to false then it would work in IE 8. First I don't like doing this method of writing my ajax requests I rather use "GET", "Post" since it is cleaner.
So now I am wondering what else is being cached when I need to to be a new result every time. Does this caching effect only "Gets" or what?
"Why not just check in the Ajax request if the session has timed out, and if it has, return an appropriate error code to the browser and handle it in the callback?"
I don't know how to check the ajax request if it timed out or not. As far I know it does not think it is timed out. Only the server knows if the server timed out. The Ajax request gets stopped at my authentication on my server and checks if the user is logged. If the user has timed out asp.net mvc automatically tries to send them to my login page which the Ajax takes and tries to render the page inside my jquery ui tabs.