node.js - Unable to obtain session in express router
ringa_lee2017-05-17 09:57:04
0
3
825
I use app.post(); directly in app.js to get the session. But I can’t get the session when I use router.post(); in the router. What’s going on? Seek the guidance of the great God
It seems that your second router is not associated with the app, so the one behind you does not enter the session middleware, causing the session to be unavailable.
Is it a matter of order? The session middleware needs to be before all routers
It seems that your second router is not associated with the app,
so the one behind you does not enter the session middleware, causing the session to be unavailable.
app.use('/xxx', router);
Is this missing?