Solved

Sessions and Load Balancing

Posted on 2003-10-30
5
323 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
  • 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
We have come a long way with backup and data protection — from backing up to floppies, external drives, CDs, Blu-ray, flash drives, SSD drives, and now to the cloud.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now