I have deployed my asp.net MVC application in a Azure environment behind load balancer. Same web application (simila files) are deployed in two Azure VMs' (cloned VMs). Deployments are identical.
Business logic Session userID is stored in the cookie (created upon sign in), therefore if the server cannot read the cookie it is directed to sign out.
Issue is that when I send a sign in request from browser, lets say it hits Server A and then it sign in successfully. After few requests, once I hit the Server B directed by the load balancer, it signs out. Similar thing happens if I sign in with server B, then I sign out once I hit server A.
Both servers can be accessed as http and https. I tried with http and https modes, issue exists in both the modes.
I replaced the Server B machine configs (both Framework and Framework64) with machine configs of Server A.
I am still getting the issue.
Here is my configuration,
<authentication mode="Forms">
<forms cookieless="UseCookies" defaultUrl="~/Home" loginUrl="~/user/signin" domain=".mydomain.net" name="FormAuthentication" path="/"/>
</authentication>
<machineKey validationKey="XXXXXXXXXX7E8095B292DFC0984B71212747191E878380CADAA8166B0D9C8E8E7B174AF38897E28F82DXXXXXXXXXXCB0CF7ABA161AAC6D86EDBCAA93704EE7FC" decryptionKey="XXXXXXXXXXDE9EA41A2423A2CD293C01050202746F5650E7" validation="SHA1" compatibilityMode="Framework20SP1"/>
More info - Servers are named like server1.cloudapplicaiton.net, server2.cloudapplicaiton.net. Application domain is like mydomain.net. Also, I programatically set the cookie name as "mydomain.net" upon Firmsauthentication sign in.
Am I missing something? Why can't a server read the cookie created by another server which has the same machine key and domain?