views:

228

answers:

2

Hi! i'm having a problem using Load-Balancing on my server (using IIS 6). I have a Manager Website that works correctly most part of the time, but sometimes when i go to another page inside this manager, instead of redirecting to the correct page, it redirects to the login page of it.

I don't think this is a timeout problem, because if i press F5 it redirects to the correct page. I suppose it's a problem with the Load-Balancing, because I tried to run the Manager in another machine without Load-Balancing (still using IIS 6) and it worked fine.

I'm using ASP.NET 3.5.

Could someone figure out why this is happening?

A: 

If session information is stored locally on a web server then when a load balancer sends your request to another server (say server2) in this farm - server2 doesn't have session information about your request and it correctly sends you to the login page. When you hit F5 load balancer sends you to the original server1 which has authentication information and successfully displays the page. You need to store session information in a central location so that all servers in the farm could see it.

DmitryK
A: 

One way is to store sessions in a centralized place, as already pointed by DmitryK, other way is to forward the request of one session to only one server. So that ASP.NET can found sessions for that. You can use Cookie based request forwarding or IP based request forwarding. IP based forwarding may not work in some cases, if the ip's are masked by some NAT(Network Address Translation). Please check what all options are provided by your load balancer.

Nitin Midha