0
votes

I have 2 ASP.NET applications on the same machine in the same application pool using the same "machineKey validationKey decryptionKey".
They are both using "form" authentication and both have the same cookie name.

If I login to site 1 "test1.test.com" and then navigate to site 2 "test2.test.com" then the httpcontext on site 2 "test2.test.com" is not the same user as it was on site 1.

Do I need to manually pass the "auth" and "role" cookies to site 2?
If so, how?

1
HttpContext can't be passed anywhere except current AppPool. The only thing that can be shared between different applications is Session - Sergey Litvinov
When I was using WCF, I could wire into the SendingRequest event of the service context and then add the "auth" cookie into the header of the WCF request. Is there a similar event when one web page is calling another web page on a different site? - goroth
HttpContext itself is tightly connected with processing of current request. It has Request, Response, and other properties that don't have any sense on another sites as they will have totally different requests. Session can be shared between application. Signed user also can be shared with the same machineKey, so it should be enough for your needs. But not the HttpContext itself. - Sergey Litvinov

1 Answers

0
votes

I did finally get this to work.
The HttpContext is not being passed between sites but the "Auth" cookies is being passed between sites as long as the domain property is being set in the web.config for forms authentication.
ASP.NET forms authentication cross app redirects not working