Comparing version 0.0.2-2 to 0.0.2-3
@@ -19,3 +19,3 @@ /** | ||
var sessions = require("../lib/sessions"), | ||
Sessions = new sessions(sessions.stores.memory, { expires: 5 }), | ||
Sessions = new sessions(null, { expires: 5 }), | ||
intervalId = null; | ||
@@ -22,0 +22,0 @@ |
@@ -7,7 +7,7 @@ var util = require("util"), | ||
function Sessions(store, opts) { | ||
function Sessions(store, opts, storeOpts) { | ||
events.EventEmitter.call(this); | ||
this.store = (typeof store != "undefined" && store !== null ? new store() : new module.exports.stores.memory()); | ||
this.opts = opts || {}; | ||
this.store = (typeof store != "undefined" && store !== null ? new store(storeOpts || {}) : new module.exports.stores.memory(storeOpts || {})); | ||
this._currentSessions = 0; | ||
@@ -167,3 +167,5 @@ | ||
} | ||
} catch (e) { } | ||
} catch (e) { | ||
throw e; | ||
} | ||
} | ||
@@ -252,2 +254,12 @@ | ||
}, | ||
remove: function () { | ||
var args = [ uid ].concat(Array.prototype.slice.apply(arguments)); | ||
if (typeof args[args.length - 1] != "function") { | ||
args.push(function () {}); | ||
} | ||
store.remove.apply(store, args); | ||
return this; | ||
}, | ||
refresh: function (expire) { | ||
@@ -254,0 +266,0 @@ meta.expires = Date.now() + ((expire || expires) * 1000); |
@@ -108,3 +108,3 @@ function MemoryStore() { | ||
for (k in items) { | ||
delete this.store[uid][items[k]]; | ||
delete this.store[uid].data[items[k]]; | ||
} | ||
@@ -111,0 +111,0 @@ } |
{ | ||
"name" : "sessions", | ||
"version" : "0.0.2-2", | ||
"version" : "0.0.2-3", | ||
"description" : "NodeJS session management", | ||
@@ -5,0 +5,0 @@ "keywords" : [ "session", "cookie" ], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21029
12
694