I am trying to enable the csrf module of Express 4 in an existing application.
I have added the following code:
var csrf = require(\'csurf\') ... ap
I have found the solution. The call to app.use(csrf()) must be set after app.use(cookieParser()) AND app.use(session({...}).
app.use(csrf())
app.use(cookieParser())
app.use(session({...})