Session validate interval #21

Merged
merged 2 commits into from Aug 8, 2012

Conversation

Projects
None yet
2 participants
Owner

neonstalwart commented Aug 6, 2012

improve the session validation logic so that it is called at intervals defined by settings.sessionTTL.

in general, it looks like the existing code has wrong logic if you were to supply options.expires but i didn't dig into that. it looks like, the setTimeout for session validation would use options.expires as a number that represents an interval of time whereas if you were to follow the logic of the code that creates sessions via session = exports.forceSession(request, options.expires);, forceSession is going to treat that value as an absolute time representing when the session expires.

neonstalwart added some commits Aug 6, 2012

@neonstalwart neonstalwart call sessionModel.validate at intervals ec409b0
@neonstalwart neonstalwart improve the session reaping logic.
 * allow validate to return a promise before calling again
 * change sign of timeout length so that it makes sense
c49943f

@kriszyp kriszyp added a commit that referenced this pull request Aug 8, 2012

@kriszyp kriszyp Merge pull request #21 from neonstalwart/session-validate-interval
Session validate interval
c69d321

@kriszyp kriszyp merged commit c69d321 into persvr:master Aug 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment