🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

mongoose-session

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-session - npm Package Compare versions

Comparing version

to
0.0.3

15

index.js

@@ -6,2 +6,3 @@ var MongooseSession = function (mongoose, options) {

options = options || {};
options.modelName = options.modelName || 'Session';
options.ttl = options.ttl || 3600;

@@ -15,3 +16,3 @@

var sessionSchema = new mongoose.Schema({
sid: String,
_id: String,
session: mongoose.Schema.Types.Mixed,

@@ -21,3 +22,3 @@ createdAt: (options.ttl ? { type: Date, expires: options.ttl } : Date)

this.SessionModel = mongoose.model('Session', sessionSchema);
this.SessionModel = mongoose.model(options.modelName, sessionSchema);

@@ -27,3 +28,3 @@ this.get = function(sid, callback) {

var self = this;
self.SessionModel.findOne({ sid: sid })
self.SessionModel.findOne({ _id: sid })
.exec(function(err, results) {

@@ -46,4 +47,4 @@ if (err) {

self.SessionModel.update(
{ sid: sid },
{ sid: sid, session: session, createdAt: new Date() },
{ _id: sid },
{ _id: sid, session: session, createdAt: new Date() },
{ upsert: true },

@@ -62,3 +63,3 @@ function(err) {

var self = this;
self.SessionModel.remove({ sid: sid })
self.SessionModel.remove({ _id: sid })
.exec(function(err, results) {

@@ -103,2 +104,2 @@ if (err) {

return new MongooseSession(mongoose, options);
};
};
{
"name": "mongoose-session",
"version": "0.0.2",
"author": "Chance Dickson <chance@chardev.se> (http://chardev.se)",
"version": "0.0.3",
"author": "Chance Dickson <me@chncdcksn.com> (http://chncdcksn.com)",
"main": "./index.js",
"repository": {
"type": "git",
"url": "git://github.com/TheRealCharDev/mongoose-session.git"
"url": "git://github.com/chncdcksn/mongoose-session.git"
},
"dependencies": {
"express-session": "~1.7.6"
"express-session": "~1.8.2"
}
}
}

@@ -29,5 +29,6 @@ # mongoose-session

* `options.ttl` : allowed time of inactivity before a session is destroyed, in seconds (3600)
* `options.modelName` : specifies the name of the collection, defaults to 'Session'
## Info
This works perfectly for my current use in projects, and requires no configuration. If your usage of mongoose-session would require any extra configuration to work properly, feel free to submit an issue or pull request, and I'll look over it and make any changes needed to be made for this to work for everyone. :)
This works perfectly for my current use in projects, and requires no configuration. If your usage of mongoose-session would require any extra configuration to work properly, feel free to submit an issue or pull request, and I'll look over it and make any changes needed to be made for this to work for everyone. :)