We are currently migrating our .NET Web Application to an Azure Cloud Service with the Web tier running on multiple nodes (Initially two). I am wondering how we should modify our forms based authentication mechanism to run in a load balancing environment? This a consideration we have never needed to make in the past as our application has always been confined to just one physical server.
Currently we define our protected folders in the web.config as such:
<location path="secure-area">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
The code in the login page works something like this:
if accountIsValid = true then
FormsAuthentication.SetAuthCookie(sessionID, False)
response.redirect("secure-area/index.aspx")
end if
Then the active session is retrieved throughout the application like this:
Dim sessionID as string = User.Identity.Name.ToString
Presumably this method will not automatically persist session state across multiple nodes? I wondered if the Azure Fabric Controller would sort all this out for me without having to make code changes. Wishful thinking maybe!
Any help or links to online guides would be much appreciated!