sxpress-session
v1.0.4
Published
session
Downloads
10
Readme
sxpress-session middleware for sxpress
example
var sxpress = require('sxpress');
var cookieParser = require('sxpress-cookie-parser');
var session = require('sxpress-session');
var app = sxpress();
app.use(cookieParser);
app.use(
session({
name: 'sid',
secret: 'sxpress secret',
cookie: {
domain: '.01zhuanche.com',
},
})
);
app.use(function (req, res, next) {
req.session.account = 'baie';
next();
});
app.use(function (req, res, next) {
console.log(req.session);
next();
});