Create an Express Session with Sequelize

PHOTO EMBED

Wed Sep 28 2022 22:08:18 GMT+0000 (UTC)

Saved by @zaccamp #javascript #mysql #sequelize #sessions

const session = require('express-session');

const SequelizeStore = require('connect-session-sequelize')(session.Store);

const sess = {
  secret: 'Super secret secret',
  cookie: {},
  resave: false,
  saveUninitialized: true,
  store: new SequelizeStore({
    db: sequelize
  })
};

app.use(session(sess));
content_copyCOPY