The Problem
Occurs on IE10. (IE8 works fine.)
I've written some JavaScript code that, after 20 minutes of inactivity, redirects the browser to another URL to indicate the user was logged out. Normally this works fine. However I've noticed a strange scenario.... if the user's Windows computer was locked during this timeout then it appears as though nothing has happened.
However, when I look at the browser's URL bar, I can clearly see that the URL has already been updated to the auto-logout page. But the entire content of the browser window is still displaying the old page!!!! For some reason, the browser window has not repainted / refreshed. It looked like it had frozen.
At this point... if I rapidly mouse click around on the page then the browser "wakes up" and shows the new content. (It seems that just one mouse click is not enough. The more rapidly you click around, the faster it "wakes up".)
Theory
My best guess is the IE10 browser stops repainting the window while the computer is locked. However, I do believe the JavaScript engine is still running though, because I tested another scenario with multiple JS new Date() time stamps at various intervals and when the screen finally repainted, each date time was unique, showing the time it actually occurred.
Recreating the Issue - version 1
- Launch the JavaScript code below in IE10
- Lock my Windows computer before 10 seconds has elapsed.
- Wait 10 seconds, and then unlock my computer.
- See the IE10 window has failed to repaint.
I did notice this only occurs when redirecting to a URL on our company's local intranet. I have no idea why this is the case.... but if I have the URL as Google or Yahoo's home page.... then I cannot recreate the issue. It just works correctly. Made me wonder if it could be a Group Policy / Trusted Zones / Intranet vs Internet issue of some sort...
<!DOCTYPE HTML>
<html>
<head></head>
<body>
<script>
var url = 'http://IntranetWebApps.OurCompany.com/MyWebApp/Home'; // fails
//url = 'http://www.yahoo.com'; // this 'Internet' site works
//url = 'http://www.google.com'; // this 'Internet' site works
setTimeout(function () {
window.location.href = url;
}, 10000 // wait 10 seconds, then execute redirect
);
</script>
</body>
</html>
Question
Does anyone have any ideas how to solve this issue, so that the IE10 window will always repaint instantly instead of displaying stale content?