J
J
John2019-09-23 11:37:20
Node.js
John, 2019-09-23 11:37:20

How to organize automatic removal of sessions from the database in node js express-sequelize-session?

Good day. so I connect sessions to the express. I set the maximum session storage time, but it is not deleted from the database, but simply when it expires, a new one appears. How it is possible to make that sessions on the expiration were deleted from base?

app.use(expressSession({
    name: 'sid',
    secret : 'key*********',
    cookie: { maxAge: 24 * 60 * 60 * 1000 },
    store: new Store(dbconnSession),
    resave: true,
    saveUninitialized : false
}))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question