node.js - NodeJS Express-Session MySQL creates new session for each request -
i have nodejs, express application using express-session mysql. on mac new sessionid set every request. result being when application looking data written session not there because on different session. same code works fine on centos testing box.
session setup code looks follows:
appconfig.db:
db: { "host" : "localhost", "database": "secure_portal", "user" : "username", "password" : "password", "debug" : true, checkexpirationinterval: 900000,// how expired sessions cleared; milliseconds. expiration: 86400000,// maximum age of valid session; milliseconds. = 24hrs }, server.js:
// sessions var sessionstore = new mysqlstore(appconfig.db); server.use(session({ secret: 'somesecret', name: 'sessionid', resave: false, store: sessionstore, saveuninitialized: true, cookie: { secure: false, //maxage: appconfig.session_length * 60 * 1000, expires: new date(date.now() + 900000000) } })); we have running fine in production. we've gone through tonne of stackoverflows , no luck.
what missing on machine?
mac 10.10.5 , using pycharm 2016.3.2
thanks.
Comments
Post a Comment