we have an application in NodeJS that is working inconstantly across our test environments with respect to sessions. Our application uploads files and places uuids for the files into the session. Then at the end of the process it goes to the session to retrieve the file uuids. Our issue is that the session id changes and the data is not in that session.
We've moved from MySQL as the session store to Mongo with no improvement so I think the issue is how we are using the sessions.
Within server.js we are using:
mongo = require('mongoose'),
MySQLStore = require('express-mysql-session')(session),
MongoStore = require('connect-mongo')(session);
var sessionStore = new MongoStore(conf.db);
server.use(session({
secret: 'somesecret',
name: 'sessionId',
resave: true,
store: sessionStore,
saveUninitialized: true,
cookie: {
secure: secure,
maxAge: appConfig.session_length * 60 * 1000
}
}));
conf.db is as follows:
db: {
"host" : "localhost",
"database": "database",
"user" : "username",
"password" : "password",
"debug" : false,
"checkExpirationInterval": 900000,
"expiration": 86400000,
"createDatabaseTable": true
},
Thanks for any help.
via Paul T
No comments:
Post a Comment