1

I have load balancer for my Rails servers (about 5 servers),

That is user won't access the same server next time when user comes back.

How can I share the session information so that user won't have to login again.

newBike
  • 14,385
  • 29
  • 109
  • 192

1 Answers1

2

You create and manage to share HTTP cookie (same domain, right?) between all available servers that have a Rails app up and running. The cookie references to session_id you store in shared database or key/value storage every application has an access to.

The best load balancing mechanism is where you can do Road-Robin and don't use Sticky Sessions. In that case any of app server can go down for maintenance without interrupt users requests.

Anatoly
  • 15,298
  • 5
  • 53
  • 77
  • did you mean i don't need to do an extra work. if i put all the web server under the same domain, that is, all the servers should be accessed be the same domain ? OR if i need to create an extra server to store session, how could i do with Rails, any keyword for me to search ? thanks – newBike Aug 20 '15 at 00:31
  • @newBike you move session to shared storage accessible from each your application server. Apart from that no extra work required. – Anatoly Aug 20 '15 at 06:54