Socket
Book a DemoInstallSign in
Socket

ajn-session

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ajn-session

A very simple and lightweight session manager

0.0.8
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

A very simple and lightweight session manager

Configuration options:

Session.sessionLifeTime Number, default is 60000 * 30, which is 60 min

Session.maxSize Number, Max size of all data stored per session in bytes, default is 262144 bytes

Session.sessionName String, Name of the session cookie, default is 'nodesess';

usage:

var Session = require('../index').Session; var http = require('http');

var srv = http.createServer(function (req, res) { // initialize a session object on each request, pass the request and // response objects to it it will discover if session is alread set, and // create one if it isn't var session = new Session(req, res);

// set foo session property value to bar
session.setData('foo', 'bar');

// get foo session property value and print it to console
console.log(session.getData('foo'));

// delete foo session property value to bar
session.delData('foo');

// print 'foo' session property to console, it must return undefined
console.log(session.getData('foo'));
....

}); srv.listen(1111, '127.0.0.1');

FAQs

Package last updated on 12 Aug 2013

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.