sessid
v0.1.1
Published
the best and easy session management library for nodejs ( php like syntax ) powerfull and secure .
Downloads
26
Maintainers
Readme
Fast, synchronized , easy and minimalist library for node session management.
const express = require('express')
const app = express()
const session = require('sessid')
app.use(session)
//start session
app.post('/login', function (req, res) {
//verify user
session.start(); //to start session for that user
//set any session data and use it in multiple pages like php
//this is optional if u want to set some session data
session.set({"id":102}); //data must be in JSON format
})
app.get('/home', function (req, res) {
//check user's session is started or not
if(session.check()){
//get session data which is previously set at the time of login
res.send('welcome user'+session.get("id"))
//to delete session data
session.unset("id")
}
})
app.get('/logout', function (req, res) {
//check user's session is started or not then allow for logout
if(session.check()){
//destroy session
session.destoy()
}
})
app.listen(3000)
Thats it easy and short .
Installation
This is a Node.js module available through the npm registry.
Installation is done using the
npm install
command:
$ npm install sessid
Follow our installing guide for more information.
Features
- easy and lite js library .
- Focus on high performance . can handle too many users at a time .
- auto temporary session data cleaner for better and fast performance .
- built in database [ see next poin to explore that ]
- used synchronized funtion for instant output .
Built in database
no doc available now . go through the library to findout yourself .
Docs & Community
- GitHub Organization for Official Middleware & Modules
Security Issues
If you discover a security vulnerability in sessid, please inform us on github .
Examples
To view the examples, clone the Express repo and install the dependencies:
$ git clone git://github.com/node-sessid/examples
$ cd node-sessid
Then run the example:
Dependancy
* no dependancy for this library
Contributing
*jishan ali mondal