Closed Jakobud closed 5 years ago
I just realized I'm using cookie session syntax from Express 3.x instead of 4.x. Works now like this:
app.use(session({
name: 'session',
keys: ['key1', 'key2'],
secret: 'cookieSessionSecret',
secure: true,
maxAge: 10000
}))
app.use(passport.initialize());
app.use(passport.session());
Thanks for following up with yourself, hit this same issue.
I am using
cookie-session
in Express with PassportJS. I am using just a LocalStrategy. When I log into my application, the browser shows the cookie'sExpires / Max-Age
as1969-12-31T23:59:59.000Z
which essentially means that it isn't going to expire. Here is my setup:The cookie session should be expiring after 10 seconds according to this. Is this something wrong with
cookie-session
not doing it's job or is this a PassportJS issue? I'm confused by the documentation because Passport seems to imply that it creates persistent sessions (which would mean it does not expire), but if you are using something likecookie-session
, then it seems like it should obey theexpires
ormaxAge
options.Environment