请教大侠,为什么我的req.sesstion一直为undefined;
 发布于 12 年前  作者 shang83211  3603 次预览  最后一次回复是 12 年前  来自  

cannot set property ‘user’ of undefined

我在app.js 引用了 app.use(express.session({}));

在index.js的app.post(’/reg’,function(req,res){ … req.sesstion.user=newUser; … })

我测试了req.sesstion为undefined;