Closed skyturkish closed 1 year ago
app.use(
session({
secret: 'anything',
store: MongoStore.create({
mongoUrl: process.env.MONGODB_CONNECTION_STRING || 'mongodb://0.0.0.0:27017/game_elo_boost'
}),
resave: true,
saveUninitialized: false,
cookie: {
maxAge: 14 * 24 * 60 * 60 * 1000,
sameSite: process.env.NODE_ENV == 'production' && 'none', <-------- This will fix
secure: process.env.NODE_ENV == 'production'
}
})
)
after logging in, the user is not stored, if we refresh the page or request a user again, it returns null from the database.