Solved

Sessions and Load Balancing

Posted on 2003-10-30
5
328 Views
Last Modified: 2011-09-20
Hello,


I'm facing a stiff problem.

After a user-login, i store his information in a session. No big deal..

but

Because we use load balancing the session is only recognised on the server it was created.

I also tried to do this with cookies but this also has the same problem.


Anyone ?


kind regars

Xyleen
0
Comment
Question by:Xyleen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 15

Assisted Solution

by:jimmack
jimmack earned 45 total points
ID: 9651743
Have a look at:

http://raibledesigns.com/tomcat/index.html

Here's a quote from the page:

 1. Session affinity works
Which means that when a client browser is directed to a Tomcat server by the load balancer, then future queries from that same browser session will always be directed to the same tomcat server. This is important because sessions that are created in a specific tomcat server, say "tomcat1", do not exist in the other server "tomcat2", and thus if the client was directed to another tomcat server than the one where his session is stored, then all his session data would be lost.

Some people are working on sessions that will be replicated across all tomcat servers in the cluster, so I'll just wait for it to become available rather than make a homebrewed distributed session mechanism.

The downside of not having sessions replicated across all the tomcat servers in the cluster is that if one tomcat server dies, all the sessions that it contained are lost, which usually makes a lot of unhappy users.
0
 
LVL 3

Assisted Solution

by:evedder
evedder earned 20 total points
ID: 9654403
maybe you can encrypt tje user information and pass it throug parameters in the URL
0
 

Author Comment

by:Xyleen
ID: 9656073
jimmack,


I don't have access to the tomcat-installation :(

Evedder,

The content displayed on the pages is being served by a content management system so that's not an option :(
0
 
LVL 15

Accepted Solution

by:
jimmack earned 45 total points
ID: 9656462
Why doesn't the cookie solution work?

Forget about storing the data in a session.  Just retrieve the cookie and check that for every page.  Perhaps you could do this with a filter to prevent having to duplicate code on all your JSPs/Servlets.
0
 

Author Comment

by:Xyleen
ID: 9657499
Hello,


I've fixed it with cookies created by javascript, they work. Cookies created by jsp don't :(

Thanks all
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
J2SE 5.0 metadata 1 71
memory representation of int[][][] a=new int[2][][]; 10 60
lessBy10  challenge 15 97
Suggestion on WebSite Template Sites 6 124
We asked our MSP customer base what their favorite tools were and how they help them serve clients. We focused our questions on favorite tools in the following categories: >PSA tools >RMM tools >Alert management tools >Communication tools and Mo…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question