fixed the rest of the bugs that arised from the redis refactor

This commit is contained in:
psychobunny
2013-05-09 05:48:55 +00:00
parent b9ec62ee20
commit 5e901a76aa
3 changed files with 12 additions and 6 deletions

View File

@@ -431,8 +431,15 @@ var config = require('../config.js'),
// Start, replace, or extend a session
RDB.get('sess:' + sessionID, function(err, session) {
RDB.handle(err);
RDB.set('sess:' + sessionID + ':uid', uid, 60*60*24*14); // Login valid for two weeks
RDB.set('uid:' + uid + ':session', sessionID, 60*60*24*14);
var expiry = 60*60*24*14, // Login valid for two weeks
sess_key = 'sess:' + sessionID + ':uid',
uid_key = 'uid:' + uid + ':session';
RDB.set(sess_key, uid);
RDB.expire(sess_key, expiry);
RDB.set(uid_key, sessionID);
RDB.expire(uid_key, expiry);
});
}