You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had an application that was working just fine for over a year. I did, however, notice regular messages in the log, similar to this:
[session-file-store] will retry, error on last attempt: Error: ENOENT, open 'sessions/tRI6WeZEO2Uyvr4ZaUGW6_CU32RjvFpW.json'
That prompted me to do some research and someone mentioned using retries=0. I used that:
const store = new FileStore({ path: config.dirs.sessionDir, ttl: 86400s, retries: 0 });
As soon as I did that, my login form on login.html would log the user in (I could see the user object getting filled in). My code redirects from /login to home.html after a successful login. Every time, home.html was convinced there was no user and redirected back to login.html. If I would then manually try to go back to home.html in the browser, everything worked.
Changing the settings to: retries: 5, immediately fixed the problem. There appears to be a timing problem that requires a retry to always happen to check the session for the first request after a successful login.
The text was updated successfully, but these errors were encountered:
I had an application that was working just fine for over a year. I did, however, notice regular messages in the log, similar to this:
That prompted me to do some research and someone mentioned using
retries=0
. I used that:As soon as I did that, my login form on
login.html
would log the user in (I could see the user object getting filled in). My code redirects from/login
tohome.html
after a successful login. Every time,home.html
was convinced there was no user and redirected back tologin.html
. If I would then manually try to go back tohome.html
in the browser, everything worked.Changing the settings to:
retries: 5
, immediately fixed the problem. There appears to be a timing problem that requires a retry to always happen to check the session for the first request after a successful login.The text was updated successfully, but these errors were encountered: