Note that there are some explanatory texts on larger screens.

plurals
  1. POIE continues executing JS after a 302 is received?
    text
    copied!<p>So, I've run into a bit of a weird issue, and I'm hoping there are some IE savants out there who may be able to shed some light on this behavior. My company runs a realtime Lift application. We use the comet model for realtime communication between browsers and the server, as is standard with Lift. Also worth noting: In the event that comets get out of sync with the server (either because of connection issues or a server restart, anything that would kill the session on the server) the server responds to that comet request with a <code>document.location.reload();</code> to reload the page, start up a new session, and so on.</p> <p>Now, to ensure that logouts happen as they should, we have a special url (/session/logout) that does all the session-related cleanup then kicks you back to our homepage. This can either be triggered by clicking an anchor to that URL or the server may issue you a 302 to that URL if you try to do something that requires you to be logged out. Simple enough, right? In most browsers, this works great because the workflow looks something like this:</p> <ol> <li>User either clicks the logout button or the server sends a 302 to /session/logout</li> <li>Javascript execution on the current page stops, so all comets shut down.</li> <li>Browser loads /session/logout</li> <li>Browser received 302 message from server (signifying the session cleanup is done) to kick the user to the homepage.</li> <li>Browser loads homepage.</li> </ol> <p>However, in IE we're seeing the following behavior:</p> <ol> <li>User either clicks the logout button or the server sends a 302 to /session/logout</li> <li>Browser starts loading /session/logout</li> <li>Browser recieved 302 message from server (signifying the session cleanup is done) to kick the user to the homepage.</li> <li>Browser starts loading homepage.</li> <li>Comets receive a <code>document.location.reload();</code> from the server because they were never shut down by IE, the loading of the homepage is aborted, and the current page is reloaded without the user logged in.</li> </ol> <p>This is entirely undesirable because we need the correct result of the /session/logout to load -- <strong>especially</strong> in situations where a user was trying to do something that they couldn't do when they were logged in (in that case the 302 returned from logout would point to wherever they were originally trying to go to).</p> <p>Has anyone run up against this kind of issue before? Any advice on how to deal with this issue?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload