79363602

Date: 2025-01-17 04:28:49
Score: 0.5
Natty:
Report link

express session has an option called rolling = true which will reset your maxAge on every server interaction. This is probably what you are looking for. Don't use expires, use maxAge, it's what they recommend anyway.

rolling: Force the session identifier cookie to be set on every response. The expiration is reset to the original maxAge, resetting the expiration countdown.

The default value is false.

With this enabled, the session identifier cookie will expire in maxAge since the last response was sent instead of in maxAge since the session was last modified by the server.

This is typically used in conjuction with short, non-session-length maxAge values to provide a quick timeout of the session data with reduced potential of it occurring during on going server interactions.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: FinalGirl321