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
Hi folks,
as doc recommended, Session.touch() will reset the timer and session itself usually does it for you when setting rolling to true. But this time I'm actually trying to manually reset the timer by calling Session.touch(), I tried req.session.touch(), req.session.Session.touch(), and Session.touch(), they all are not working (the purpose of doing it is to fire a command to the backend and triggered touch command). What should I do in this case?
The text was updated successfully, but these errors were encountered:
Maybe you only need to use resave: true instead touch():
"Depending on your store this may be necessary, but it can also create race conditions where a client makes two parallel requests to your server and changes made to the session in one request may get overwritten when the other request ends, even if it made no changes (this behavior also depends on what store you're using).
The default value is true, but using the default has been deprecated, as the default will change in the future. Please research into this setting and choose what is appropriate to your use-case. Typically, you'll want false.
How do I know if this is necessary for my store? The best way to know is to check with your store if it implements the touch method. If it does, then you can safely set resave: false. If it does not implement the touch method and your store sets an expiration date on stored sessions, then you likely need resave: true."
Hi folks,
as doc recommended,
Session.touch()
will reset the timer and session itself usually does it for you when setting rolling to true. But this time I'm actually trying to manually reset the timer by callingSession.touch()
, I triedreq.session.touch()
,req.session.Session.touch()
, andSession.touch()
, they all are not working (the purpose of doing it is to fire a command to the backend and triggered touch command). What should I do in this case?The text was updated successfully, but these errors were encountered: