Package Exports
- memorystore
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (memorystore) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
memorystore

express-session full featured
MemoryStoremodule without leaks!
A session store implementation for Express using lru-cache.
Because the default MemoryStore for express-session will lead to a memory leak due to it haven't a suitable way to make them expire.
The sessions are still stored in memory, so they're not shared with other processes or services.
Setup
$ npm install express-session memorystorePass the express-session store into memorystore to create a MemoryStore constructor.
var session = require('express-session')
var MemoryStore = require('memorystore')(session)
app.use(session({
store: new MemoryStore(options),
secret: 'keyboard cat'
}))Options
checkPeriodThe period in ms, as a number, used for the automatic delete check interval. By default every 24 hour.maxThe maximum size of the cache, checked by applying the length function to all values in the cache. It defaults toInfinity.ttlSession TTL (expiration) in milliseconds. Defaults to session.maxAge (if set), or one day. This may also be set to a function of the form(options, sess, sessionID) => number.disposeFunction that is called on sessions when they are dropped from the cache. This can be handy if you want to close file descriptors or do other cleanup tasks when sessions are no longer accessible. Called withkey, value. It's called before actually removing the item from the internal cache, so if you want to immediately put it back in, you'll have to do that in anextTickorsetTimeoutcallback or it won't do anything.staleBy default, if you set amaxAge, it'll only actually pull stale items out of the cache when youget(key). (That is, it's not pre-emptively doing asetTimeoutor anything.) If you setstale:true, it'll return the stale value before deleting it. If you don't set this, then it'll returnundefinedwhen you try to get a stale entry, as if it had already been deleted.serializerAn object containingstringifyandparsemethods compatible with Javascript'sJSONto override the serializer used.
Debug
To enable debug set the env var DEBUG=memorystore
Author
Rocco Musolino (@roccomuso)
License
MIT