Solved

Sessions and Load Balancing

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
netstat -a in AIX unix 8 42
Export JSON response data to Excel in IE9 3 75
instanceof  operator in java 26 91
login jsp example 24 49
SEO can be a real minefield to navigate, but there are three simple ways to up your SEO game just be re-assessing your content output.
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 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