expressjs / expressjs/session

Exclude routes from renewing express cookie expiration date

Open
#583 4 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
6.4k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

This issues somewhat related to - #452

In my project I need to have dynamic max-age for the set-cookie that authenticate the users.
so on each request the user made to the server the max-age will get updated (in an hour or several..).
However, there is several periodic routes which run every 30 seconds that shouldn't update the cookie max-age (because they are not user action).
So after let say one hour the user didn't do any action in the system, the user session will get expired.

So if I configure the session with 'rooling' set to false (because there are response I don't want to update the max-age), it seem I can't get express
to put 'set-cookie' with my max-age at all (on all requests).

how should I solve this kind of problem? what approach should I take to have express only update the max-age of specific requests.

For example code of the problem - https://stackoverflow.com/questions/40403609/how-to-exclude-routes-from-renewing-express-cookie-expiration-date

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.