Max age resetting after response
See original GitHub issueIs there a reason the max age is reset with each response? I need to be able to see if half of TTL has elapsed. The cookies expiration is being increased but the session still expires at the original max age.
// proxy end() to commit the session
var end = res.end;
res.end = function(data, encoding){
res.end = end;
if (!req.session) return res.end(data, encoding);
debug('saving');
req.session.resetMaxAge();
req.session.save(function(err){
if (err) console.error(err.stack);
debug('saved');
res.end(data, encoding);
});
};
Issue Analytics
- State:
- Created 10 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Maxage of my cookie is reset to -1 - Stack Overflow
This is expected behaviour. Take into account that max-age applies to a client-side, but clients will only send to server the pair name ......
Read more >Access-Control-Max-Age - HTTP - MDN Web Docs
The Access-Control-Max-Age response header indicates how long the results of a preflight request (that is the information contained in the ...
Read more >How can I reset the max-age cache control of my page being ...
I have tried to add the following code on the page, restarted the server. No redirection happened, but then the page was totally...
Read more >Cache-Control - HTTP
Specifying no-cache or max-age=0 indicates that clients can cache a resource and must revalidate each time before using it. This means HTTP request...
Read more >Keeping things fresh with stale-while-revalidate - web.dev
A Cache-Control response header that contains stale-while-revalidate should also contain max-age , and the number of seconds specified via max- ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
express 4 is out now, what’s the reason why the bug is not fixed yet?
This issue is not prioritized and has not had meaningful activity for some time. It can be re-opened when a PR is raised, if needed.