var session = require(‘express-session’); var redisStore = require(‘connect-redis’)(session); //提供session支持 app.use(session({ secret: settings.cookieSecret, store:new redisStore({ host:’127.0.0.1’, port:’6379’ }) }));
app.use(function(req,res,next){ if (!req.session) { console.log(“session 为空”); }else{ } next(); }); 为什么访问不到session,
3 回复