When working with sessions in Web Applications you have consider clustered environment. That means that there will be some Load Balancer in from of server which host your application. In this cases that means that every incoming request can be routed to the different machine.
Depending on Load Balancer configuration (if feature available) there is a way to force all incoming request from one client to the same machine. This is called Sessions Affinity or Sticky Sessions. This is mostly useful feature if your application implement local cache. In this case it is required that the client remains at the same server, because routing client request to the next machine would cause inconsistent sessions state.
Windows Azure Load Balancer does not provide Sticky Sessions. This is very important to know. However if you want to use caching use AppFabric distributed cashed. Interestingly, when working with Eclipse Sticky Sessions are provided in Windows Azure.
Note that this is not Windows Azure feature. It is implemented as a IIS module which is automatically deployed by eclipse when your application is deployed. tHIS http MODULE IS CALLED Application Request Routing (ARR). This module track clients and correlates them to the right server, where they have been server for the first time. If the Windows Azure Load Balancer routes request to the machine which in term of Sticky Sessions should not server the request, the module will figure that out and reroute the request internally to the right node. For more information about this take a look here.
May 17 2012, 10:56 AM