Nodejs third-party github login information cannot be written to session

github.js (used for github third-party login)

  Middleware check.js code stamp here  


solved, because the github login is redirected in http mode after successful login, so express-session needs to set secure: false

app.use(session({
    secret: 'Stefanie Sun',
    store: sessionStore,
    resave: true, //  session
    saveUninitialized: true,  // 
    cookie: { 
        maxAge: 3 * 3600 * 1000,  // 
        secure: false // http  secure  false
  }, 
    rolling: true
}))

blame me for not reading the document carefully. =

Menu