search

Home  >  Q&A  >  body text

node.js - express, when I click to log in, a jump error occurs and the request data is undefined. Please help me, brother

Just say user is undefined and I’m so anxious! Please help

为情所困为情所困2819 days ago897

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-31 10:43:40

    Set value can only be a session problem.

    1. Install middleware express-session
    Documentation

    $npm install express-session
    

    2.Mount

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

    reply
    0
  • Cancelreply