echobind / bisonapp

A Full Stack Jamstack in-a-box brought to you by Echobind
MIT License
590 stars 28 forks source link

fix: Login session lifetime could be shorter than expected. #279

Closed cullylarson closed 2 years ago

cullylarson commented 2 years ago

In context/auth, since now is defined outside of the component, COOKIE_EXPIRE_DATE will always be the same value as long as the user doesn't refresh the browser. So if we allow users to stay logged in for 30 days, a user loads the page, keeps their browser open for 29 days, then logs in, their session will only last 1 day.

Probably not a huge deal (especially since our default session lifetime is 1 year). But it could be an issue if someone wants to use very short sessions.

Changes

I generated an app and logged in. The session lifetime is still one year, as expected.

Checklist