Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jun 14, 2012
1 parent d3c86fc commit 692229e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/connect-redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ module.exports = function(connect){
var maxAge = sess.cookie.maxAge
, ttl = this.ttl
, sess = JSON.stringify(sess);
if (ttl == null) ttl = 'number' == typeof maxAge

ttl = ttl || ('number' == typeof maxAge
? maxAge / 1000 | 0
: oneDay
: oneDay)

debug('SETEX "%s" ttl:%s %s', sid, sess);
this.client.setex(sid, ttl, sess, function(err){
Expand Down

0 comments on commit 692229e

Please sign in to comment.