When an AJAX request is returned an HTTP 401 code (Unauthorized), the user is redirected to the login page.

This is intended for the case in which the user opens the browser and the read page is loaded from the cache, but the AJAX requests to retrieve feeds, folders etc never return valid data because the session has expired.