politeiagui
politeiagui copied to clipboard
Unexpected session expiry
I'm reading through a long tree of comments and periodically a "Session expired" modal pops up in response to my actions (comment upvotes) and asks me to log in. I must add that it eats a lot of CPU to do so.
I cancel the modal and refresh the page or open the same link in another tab, and remain logged in, so I guess it's a false error. There appears to be "page session" and "login session" with different timeouts.
Hey @xaur the login is required in order to renew your CSRF token, hence the modal is displayed for every action that requires a valid CSRF. See https://github.com/decred/politeiagui/pull/2541. On the other tab, the login is still active because you were never logged out, but it will also display the error message for expired sessions. Thanks.
On the other tab, the login is still active because you were never logged out, but it will also display the error message for expired sessions.
Sorry I don't quite follow, but let me reword what I observed:
- I opened a proposal with maany comments and started slowly reading and voting on them
- At some point I would get a "Session expired" modal
- I ignore the modal and refresh the page (or ignore it and open a new tab)
- I am still logged in and can continue to vote on comments
It is confusing to see the modal it if my session is not really expiring.
hmm can you give us a concrete example or some links of this happening? How long did your "slowly reading" take? Was it like more than one day? Was it displayed during your session (while you navigate without taking more than 24h)? Do you have your localStorage enabled on your env?
The proposal link was this.
I don't remember how long I had the browser tab open at this point, it could have been less or more than 24h, or both. I'm pretty sure I had instances when the popup appeared after like an hour or less of the tab being open.
I just "got rid" of it with page refresh and continued comment voting, because I knew the session must be longer.
localStorage is enabled and without it Politeia won't load. Firefox reports Politeia consumes 44 KiB of data as of writing.
Let me know if I can provide anything else to hunt it down.