New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

session-memory-store

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

session-memory-store

Memory store for session that can auto check expired.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1.7K
-21.98%
Maintainers
1
Weekly downloads
 
Created
Source

session-memory-store

A session store implementation for Express using node-cache.

Because the default store for express-session -- memory-cache will lead to a memory leak due to it havn't a suitable way to make them expire.

And this is why I make this project, for those who want to use in-memory session, also want them to auto expire.

WANING

The session is still storing in memory, you can't share the session with others process or other service.

It's highly not recommend to use it in production!

USAGE

var express = require('express'),
  session = require('express-session'),
  cookieParser = require('cookie-parser');

// for express 4.0+
var MemoryStore = require('session-memory-store')(session);

// for express 4.0-
// var MemoryStore = require('session-memory-store')(express);

var app = module.exports = express();

app.use(cookieParser());

app.use(session({
  name: 'JSESSION',
  secret: 'my secret',
  store: new MemoryStore(options)
}));

OPTIONS

options.expires

(Number) Defined how long each session will be expired. In second. Default: half a day, 60 * 60 * 12

options.checkperiod

(Number) Defined how long MemoryStore will check for expired. In second. Default: 10 minutes, 10 * 60

FAQs

Package last updated on 01 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts