Some users tend to keep Discourse opened for weeks/months. Unfortunately, users get a “network error” when they are trying to browse the forum with an expired session.
I can easily reproduce this behavior by setting the session expiry time to 1 hour, wait 1 hour and try to open my profile or a topic… Eventually i would get this network error issue.
From my perspective, we should redirect the users to the login/sso page when their session is expired. Is there anyway to achieve that?
Thank you for your answer. My beloved users never restart their computer and tend to have tons of tabs loaded. They keep the main page opened and then from time to time, they open topics/their profile… I don’t expect/want them to keep it opened but that’s what they are doing… When I tell them to close all tabs they answer me “no because then I will have to login again”
I would expect users to be redirected to the login/sso page once their session expires.
I had this exact same problem. That was one of the reasons I did the PR for a shorter session in the first place.
When the session cookies expires Discourse get’s crazy. A public topic will get loaded, but timings, notifications and everything will start to fail silently and will eventually break.
Ideally we would have a exception treatment in our Discourse.ajax function that would popup saying that the session expired, click to refresh/login.
This would help enterprise setups with small sessions (because of IT audits or shared computers) and tab hoarders alike.
We just need to be careful to capture this correctly. I think it’s when your xhr gets a 302 with location being ${Discourse.base_url}\login.