Exchange sessions between two domains

I have two web applications: one in .net 3.5 and the other in .net 4.0 (MVC with Razor). I downloaded the 3.5 framework application in the main domain and 4.0 in the application. I want to share a session between this application. I am using session state mode as sql server. I tried solutions, such as applying the application name in the SQL Server connection string and changing the TempGetAppID stored procedure in ASPState . It works fine in local mode, but when I load it, it does not share the session. Then I also tried exchanging cookies between domains, but also did not work. Therefore, I think it requires some changes in the server, but I do not know where to make the changes. Can anybody help?

+5
source share
1 answer

One of the things that most often differ in production environments is that each application has its own machine key. You can generate one with this generator and put it in the configuration of both applications so that they can decrypt cookies from another application. By default, session state also has a cookie that contains the session key, and in order to be able to share sessions, you must first share cookies.

0
source

All Articles