fix for multiple cookies support (Also fix for, when session is not valid anymore)

This commit is contained in:
goldquest 2012-12-06 02:01:38 +01:00
parent 4ce16b526e
commit 7631096135
1 changed files with 8 additions and 2 deletions

View File

@ -133,10 +133,16 @@ exports.checkAccess = function (padID, sessionCookie, token, password, callback)
var now = Math.floor(new Date().getTime()/1000); var now = Math.floor(new Date().getTime()/1000);
//is it for this group? //is it for this group?
if(sessionInfo.groupID != groupID) return; if(sessionInfo.groupID != groupID) {
callback();
return;
}
//is validUntil still ok? //is validUntil still ok?
if(sessionInfo.validUntil <= now) return; if(sessionInfo.validUntil <= now){
callback();
return;
}
// There is a valid session // There is a valid session
validSession = true; validSession = true;