Keep getting this warning & error when I lift my app and can't figure it out. Hoping someone has an idea about this:
warn: Socket disconnected, but session could not be loaded to pass to configured disconnect handler:
sails.config.sockets.onDisconnect(). Will pass a fake, empty session as argument to lifecycle callback. Details: Error: Session could not be loaded at _createError (/Users/JAT/Dropbox/Bottage/bottage_app/node_modules/sails/lib/hooks/session/index.js:271:21) at Immediate._onImmediate (/Users/JAT/Dropbox/Bottage/bottage_app/node_modules/sails/lib/hooks/session/index.js:274:13) at processImmediate [as _immediateCallback] (timers.js:358:17) { [Error: Session could not be loaded] code: 'E_SESSION' }
wZVanG Edit: The problem is already fixed, however I wonder if I have the correct configuration:
sailsrc (I removed the models from Sails created by default because I just use mongoose), However the sockets I did not have to remove them:
"hooks": {"orm": false, "pubsub": false, "blueprints": false}
/config/sessions.js
adapter: 'mongo',
host: 'localhost',
port: 27017,
db: 'page',
collection: 'sessions',
This stores it in my Mongo database:
{
"_id" : "Nt90RxTcHkOT9aM3qJ1QzxyHlnvFoUuw",
"session" : "{\"cookie\":{\"originalMaxAge\":null,\"expires\":null,\"httpOnly\":true,\"path\":\"/\"},\"passport\":{}}",
"expires" : ISODate("2015-07-24T10:59:42.551Z")
}
It is correct?