Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sessionstore

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sessionstore - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

10

lib/databases/elasticsearch.js

@@ -7,2 +7,3 @@ 'use strict';

async = require('async'),
jsondate = require('jsondate'),
elasticsearch = require('elasticsearch');

@@ -149,5 +150,8 @@

if (typeof res == 'undefined') return callback(null, null);
if (res._source && res._source.expiresAt && (new Date(res._source.expiresAt)).getTime() > Date.now()) {
delete res._source.expiresAt;
return callback(null, res._source);
if (res._source) {
var sess = jsondate.parse(JSON.stringify(res._source));
if (sess.expiresAt && sess.expiresAt.getTime() > Date.now()) {
delete sess.expiresAt;
return callback(null, sess);
}
}

@@ -154,0 +158,0 @@ callback(null, null);

{
"author": "adrai",
"name": "sessionstore",
"version": "1.2.1",
"version": "1.2.2",
"private": false,

@@ -6,0 +6,0 @@ "main": "index.js",

@@ -113,2 +113,21 @@ # Introduction

## Connecting to elasticsearch
var sessionstore = require('sessionstore');
var express = require('express');
var app = express();
app.use(express.session({
store: sessionstore.createSessionStore({
type: 'elasticsearch',
host: 'localhost:9200', // optional
prefix: '', // optional
index: 'express', // optional
typeName: 'session', // optional
pingInterval: 1000, // optional
timeout: 10000 // optional
})
}));
## Catch connect ad disconnect events

@@ -115,0 +134,0 @@

@@ -1,2 +0,2 @@

#### v1.2.1
#### v1.2.2
- added elasticsearch support

@@ -3,0 +3,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc