‘session’ is undefined when using express / redis for session store

Sessions won’t work unless you have these 3 in this order:

app.use(express.cookieParser());
app.use(express.session());
app.use(app.router);

I’m not sure if router is mandatory to use sessions, but it breaks them if it’s placed before them.

Leave a Comment