我已经用Passport.js实现了AUTH,使用Redis作为会话存储。一切都很好,但由于某种原因,cookie的过期时间比设定的时间早得多(如果网站在几个小时后没有在浏览器上打开/激活)。我对饼干不是很熟悉;passport.js。这些配置中的任何一个会使maxAge字段之前的会话cookie无效吗。提前谢谢!
sessionMiddleware: session({
secret: 'MY_SECRET',
resave: false,
proxy: true,
saveUninitialized: false,
store: new RedisStore({ client: redisClient }),
cookie: {
domain: 'example.com',
secure: true, // true for production (https)
sameSite: 'None',
maxAge: 1000 * 60 * 60 * 24 * 7 * 4,
httpOnly: true,
path: '/',
},
}),