I have a web interface that does long polling, ie every 10 seconds it updates some statuses on the webpage using an AJAX request on an interval. I am able to, on some condition, return a 303 redirect to "kick" the user from the page. It doesn't seem to work. Chrome/FireFox.
Looking at Chrome's Network tab
- Browser opens page
- Browser is requesting JSON data every 10 seconds
- On next request, instead of a 200 with JSON data, a 303 is returned
- The page to be redirected to appears as a request (200, xhr) but the browser does not redirect. It just carries on.
The 303 appears with the following
Connection: close
Content-Type: text/html
Location: /kicked
The next request is immediately the kicked page, but it's in an XHR request instead of the browser redirecting there.