Hi
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.
I do this because my whole site is javascript so what I found was if a user walked away for 30mins and came back and tried to do an action to the server the server would figure out the user was logged out and it would try to redirect the user to my sigin page. The thing was since the request was an ajax request the html code for the login page would be sent back instead and it would render on that page. So if the action they where clicking on was say to change to another ajax enabled Ui Tab. It would render my sign in page it that UI tab and would look nasty.
So I had to come up with a way that the javascript would timeout before the server to avoid this.
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).
// javascript
// View(only has the script files)
//Severside code(Controller)
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?
Like I know browsers cache the actual javascript but I did not know IE 8 went so hard core and cached like the method stuff to. I am now wondering how anything on my site work in IE 8 since now I don't know when I do an ajax request if that is some cached result or something.
Thanks