node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org ยป

mongoose-session-store

Implementation Note:

Needs a mongo active connection

Install

npm install mongoose-session-store

Usage

Create session store:

var MongooseSession = require("mongoose-session-store");
var MongooseSessionStore = new MongooseSession({
    interval: 120000 // expiration check worker run interval in millisec (default: 60000)
});

Configure Express

var express = require("express");
...
// configure session provider
app.use(express.session({
    store: MongooseSessionStore,
    ...
});
...

That's it.