Solved

Sessioning problem with load balancing

Posted on 2004-08-19
5
1,378 Views
Last Modified: 2011-10-03
Hi,
I have two web servers running under a load balancer. They are Windows 2003 servers, run IIS 6.0, and host ASPX pages (.NET version 1.1). My problem is that whenever the load balancer switches from server A to B or vice versa, a new session is created and the Session_Start method fires. This results in the existing session data being lost. Both servers have SQLSessioning enabled, and have the same web.config & machine.config files.

Can somebody help me out in solving this problem?

Thanks,
Karun.
0
Comment
Question by:KarunSK
[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
5 Comments
 
LVL 34

Expert Comment

by:Dave_Dietz
ID: 11849246
What are you using to load balance the servers?

The behavior you describe is exaclty as expected if you don't have some sort of affinity set for sessions.  In WLBS you would set the Affinity.  Some other hardware balancers use different terms for roughly the same meaning (Cisco uses the term Sticky if I remember correctly).  Any decent load balancing technology should be able to handle this since SSL will also break if you switch endpoints in the middle of a session.

Dave Dietz
0
 
LVL 4

Expert Comment

by:philippe_leybaert
ID: 11851685
You should store session state on one of the 2 servers (or a seperate server), and change your session management in web.config to use the session state server like this:

<sessionState mode="StateServer"
  stateConnectionString="tcpip=MYSTATESERVER:42424" />

This way, all your load balanced servers will use the same session database, stored at "MYSTATESERVER". Just make sure the "ASP.NET State Service" is running on "MYSTATESERVER"
0
 
LVL 6

Author Comment

by:KarunSK
ID: 11852664
Thanks for the replies. I have SQLSessioning enabled. The web.config entry is something like this:

<sessionState mode="SQLServer" sqlConnectionString="Server=[servername];UID=[user];PWD=[password]" cookieless="false" timeout="720"/>

Since the same web.config is present in both servers, they both hit the same SQL server for sessioning.

Any more ideas?

Thanks a lot,
Karun.
0
 
LVL 6

Author Comment

by:KarunSK
ID: 11905219
Hi,

I got the solution! This problem arose because the web site ID on both the web servers was different. Once I edited the IIS metadata (an XML file under c:\windows\system32\inetsrv for IIS 6.0) and changed the web site ID so that the numbers matched on both web servers, I no more encountered this problem.
0
 

Accepted Solution

by:
RomMod earned 0 total points
ID: 11909966
The question has been PAQ'd and the 500 points have been refunded.
RomMod
Community Support Moderator
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 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