My session are not being cleared on AppFog. My setup is as follows:
Node.js (with express) mongoDB connect-mongo for the session store mongoHQ for hosting my db.
I've hooked up my local setup to use the mongoHQ db instance and all my sessions are being cleared great. But when running the app from AppFog the sesssions does not get cleared.
My session middleware:
app.use(express.session({
secret: 'my secret here',
cookie: { maxAge: new Date(Date.now() + 360000)},
store: new MongoStore({
url: connectionEnv.dbConnection
})
}));
And here is an example of using and clearing a session:
console.log(req.session.errors); // Session has a value as intended
res.render('contact', {
user: username,
email: email,
messages: req.session.messages,
errors: req.session.errors
});
req.session.messages = null;
req.session.errors = null; // The session is beeing cleared
console.log(req.session.errors); // Session is now null
But if I refresh the page now the session has somehow gotten it's value back. This only happens when running the app from AppFog.