userbase icon indicating copy to clipboard operation
userbase copied to clipboard

localStorage session expires too early

Open shamblesides opened this issue 5 years ago • 3 comments

To reproduce:

  1. Log in with rememberMe: 'local'. I said to remember me for 1 year to test with.
  2. Check localStorage; userbaseCurrentSession will have a correct expirationDate
  3. Refresh the page and wait for userbase to initialize
  4. Check localStorage; userbaseCurrentSession will now have an expirationDate that is too early
  5. This causes the session to expire too early!

shamblesides avatar Sep 19 '20 12:09 shamblesides

Are you passing a sessionLength param to init as well?

j-berman avatar Sep 19 '20 20:09 j-berman

Oh, I remember reading about how that was an argument in the docs but I completely forgot it! Thanks!

That said, I think it's pretty surprising that not specifying this in the init call will actually reduce the session length when the user logs in.

shamblesides avatar Sep 20 '20 02:09 shamblesides

Agreed. Most sensible default behavior if session length is not specified in init would maintain the session length already set (neither reduce nor extend the session length).

Will keep this open until implemented

j-berman avatar Sep 20 '20 22:09 j-berman