Solved

Sessions and Load Balancing

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 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