politeiagui icon indicating copy to clipboard operation
politeiagui copied to clipboard

Unexpected session expiry

Open xaur opened this issue 3 years ago • 4 comments

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.

xaur avatar Dec 10 '21 05:12 xaur

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.

victorgcramos avatar Dec 13 '21 22:12 victorgcramos

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:

  1. I opened a proposal with maany comments and started slowly reading and voting on them
  2. At some point I would get a "Session expired" modal
  3. I ignore the modal and refresh the page (or ignore it and open a new tab)
  4. 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.

xaur avatar Dec 14 '21 02:12 xaur

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?

victorgcramos avatar Dec 14 '21 15:12 victorgcramos

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.

xaur avatar Dec 14 '21 15:12 xaur