Socket
Socket
Sign inDemoInstall

mongoose-session

Package Overview
Dependencies
17
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 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. :)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc