I'm using express with nodejs and sessions don't stick in Firefox. The work fine in Chrome however.
I have my maxAge to 14400000 which I've read could be an issue since my local machine is on GMT, but still it doesn't seem to stick.
This is what I have configured:
app.use(express.cookieParser());
app.use(express.session({ secret: 'mysecret', store: new RedisStore, cookie: { maxAge: 14400000 }}));
I'm setting it simply by doing:
req.session.user = 'something'
Any ideas what this could be?
Thank you!
Try using req.session. regenerate(callback)
when you first establish the session. It would look something like this:
app.use(express.cookieParser());
app.use(express.session({ secret: 'mysecret', store: new RedisStore, cookie: { maxAge: 14400000 }}));
var user = //Define your user
req.session.regenerate(function() {
req.session.user = user;
res.redirect('/loggedin');
});
Give it a try!