Skip to content

Commit

Permalink
Merge pull request #1675 from ajaxorg/session-fix
Browse files Browse the repository at this point in the history
Session fix
  • Loading branch information
gjtorikian committed Jun 8, 2012
2 parents 4bde320 + b924926 commit 6d88db3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion plugins-server/cloud9.session.file/session-ext.js
Expand Up @@ -48,7 +48,17 @@ var FileStore = function(options) {
console.error(err);
return;
}
var sess = JSON.parse(data);
if (data.toString() === "") {
self.destroy(file);
return;
}
var sess;
try {
sess = JSON.parse(data);
} catch(err) {
console.warn("Error '" + err + "' while reading session from file: " + self.basePath + "/" + file);
return;
}
var expires = (typeof sess.cookie.expires === 'string')
? new Date(sess.cookie.expires)
: sess.cookie.expires;
Expand Down

0 comments on commit 6d88db3

Please sign in to comment.