when you launch Chrome with a Moodle tab from yesterday still open you get multiple "servicenotavailable" error boxes. If you then reload the page, you get redirected to the login page.
Users shouldn't see this "servicenotavailable" error if the problem is that they're not logged in.
I have already tested and debugged this and found out the reason for the error: In this case it is AJAX calls being performed while the user is not logged in.
The user is not logged in because his last session timed out. Normally when he opens a Moodle page he would get redirected to the login page. However, what happens here is: Chrome opens the Moodle page when being launched because that page was open when Chrome was last closed. But it doesn't refresh the page by sending a new HTTP request which would redirect the user to the login page. Instead it displays the page as if the user was logged in which leads to the AJAX calls failing.
How do I prevent this from happening?
Just using another browser or changing some browser settings won't work for us as we don't have control over that. I also don't want to "hack" Moodle's core code as that would make it harder to maintain.
Any help appreciated,