Error reporting when using connect.session

  node.js, question

Session it will prompt connect.session a function.
I have already introduced

var connect = require('connect');
 var cookieParser = require('cookie-parser');
 var bodyParser = require('body-parser');
 
 
 app.use(bodyParser.json());
 app.use(bodyParser.urlencoded({extended: false}));
 app.use(cookieParser());
 
 app.use(connect.session({
 secret: 'party',
 key: 'party',
 cookie: { maxAge: 1000 * 60 * 60 * 24 * 30 }
 }));

Ask the great god for advice

First, installation is requiredexpress-session.

npm install --save express-session

Then, similar to the following use.

var session = require('express-session');
 
 app.use(session({
 secret: 'keyboard cat',
 resave: false,
 saveUninitialized: true
 }))

For details, please refer to official documents.https://www.npmjs.com/package …