wood burning stoves 2.0*
The moose likes Servlets and the fly likes How to work with sessions across two servers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to work with sessions across two servers" Watch "How to work with sessions across two servers" New topic
Author

How to work with sessions across two servers

Dinesh Kumar
Ranch Hand

Joined: Jul 03, 2002
Posts: 54
IF I have two different application servers that are to be load-balanced (serving one application eventually), how do I maintain sessions?
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Most commercial application servers support some sort of HttpSession failover functionality. The details of how this is done vary between severs and the load-balancing strategy/product used.

Basically, when a session object is created it is given an ID and saved a table in a database. When the balancer identifies a failure, if goes to the database and gets the session object and sends it to the second server. There are various design strategies for this behavior, i.e. memory-based replication.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to work with sessions across two servers
 
Similar Threads
Two Web applications deployed under two different Servers
Session tracking issues
Communicate between two Sessions
Tracking a session between Weblogic and ATG
Max Length of a session