-
-
Notifications
You must be signed in to change notification settings - Fork 995
Closed
Labels
Description
Hello.
I've modified Node.js' Express.js MemoryStore store to support session expiration (session timeout).
Here is the link to the forked class:
https://github.com/kuchumovn/session/blob/master/session/memory.js
Everything there seems self explanatory.
If you find this code useful I can make a pull request.
If not then here are some keywords for google.
Usage for regular users who came here from google or stackoverflow:
1 . Download the memory.js file from the link above and add it to your project
2 . Modify the file in the beginning - replace this:
var Store = require('./store')
with this:
var Store = require('express-session').Store
3 . In your express initialization code:
var BetterMemoryStore = require(__dirname + '/memory')
var store = new BetterMemoryStore({ expires: 60 * 60 * 1000, debug: true })
require('express-session')({ ..., store: store, ... })
4 . You should turn off the debug parameter in the code above for production. The expires parameter is in milliseconds