expressjs-session-check
v1.0.4
Published
This is a simple tool to check if your session variable is not null and redirect to the specified location.
Downloads
2
Maintainers
Readme
ExpressJS-Session-Check
This is a simple tool to check if your session variable is not null and redirect to the specified location.
Installation
npm i expressjs-session-check
Usage
Specify the location of your views directory
const checkSignIn = require('expressjs-session-check');
How to use it in your code:
const checkSignIn = require('expressjs-session-check');
router.get('/SessionTest', function(req, res, next) {
user = req.session.user;
checkSignIn(user, "/RedirectRoute", res);
res.render('Session/index',{title:"Session Test"})
});