Question

I am running multiple instances of node.js on Appfog. I need sticky sessions since I use engine.io. When I create multiple instances engine.io (with http long polling) is not working properly - in addition passport.js authentication is also failing. I am assuming this is owing to improper session affinity. I am setting the session cookie key as: jsessionid based on the cloudfoundry article here: http://blog.cloudfoundry.com/2013/01/24/scaling-real-time-apps-on-cloud-foundry-using-node-js-and-redis. From server logs, the jsessionid cookie is appearing properly at the server side during engine.io poll/write requests. Does AppFog load balancer use session affinity based on 'jsessionid' cookie found in the request?

Additional Note: If I clear client-side cookies and access the site, both passport and engine.io seems to be working until I restart the instances.

Was it helpful?

Solution

I think I have fixed the issue using the information given in: http://blog.cloudfoundry.com/2013/01/. Basically the jsessionid becomes invalid for session affinity after server restart and we have to refresh the session.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top