I have this as configuration of my Express server
app.use(app.router); app.use(express.cookieParser()); app.use(express.session({ secret: \"keyboard cat\" }
This is also one possibility: Make Sure that you should write this code before the route in your app.js(or index.js) file.
app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json());