Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max age resetting after response #2

Closed
jonathanong opened this issue Feb 16, 2014 · 8 comments
Closed

Max age resetting after response #2

jonathanong opened this issue Feb 16, 2014 · 8 comments
Assignees
Labels
Milestone

Comments

@jonathanong
Copy link
Member

Is 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);
      });
    };
@dougwilson
Copy link
Contributor

It should only grow (i.e. get reset) when rolling sessions is enabled.

@dougwilson
Copy link
Contributor

Fixing this would require a major version bump, sadly :(

@timaschew
Copy link

Fixing this would require a major version bump, sadly :(
dougwilson added this to the 2.0.0 milestone on 5 Jan 2015

express 4 is out now, what's the reason why the bug is not fixed yet?

@dougwilson
Copy link
Contributor

@timaschew , I'm unsure what the major version of this module has to do with the version of Express.

@HarshithaKP
Copy link

@jonathanong Just wondering this is not a bug. Once client requests and is being active, to keep the session interactive, maxAge of cookie is been refreshed with each response as cookie expiry disconnects client from session with ongoing interactions.

cc @dougwilson

@dougwilson
Copy link
Contributor

Hi @HarshithaKP I have never heard of the issue you are describing. Can you provide code and steps to reproduce the issue you are referring to?

@HarshithaKP
Copy link

@dougwilson Sorry that assumption was a mistake, I will go through the issue again and get back to you.

@davidmashe
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants