Transferring Session Data Between ASP.NET Web Applications

I am trying to help a friend - they have a rather large web application (ASP.NET 4.0, Visual Basic) in which there are several subfolders that all act as quasi-sub-applications (but they are just subfolders of the main application). This application will be divided into several independent web applications, because in its current form it is difficult to maintain and develop further.

The problem is that the current monolithic application uses several session variables for things like user information (after logging in, etc.). I wonder if there is an easy way to safely transfer this information among future multiple web applications (which will obviously be independent sessions). Session state is stored in SQL Server. The users of the current web application are all external users, and not all users have access to all “sub-applications”.

I am looking for some tips about these two things:

1. I already did a search and found a one-time registration - this seems to solve the authentication problem in these applications, but I am not familiar with it, and I do not understand how the authentication information is deleted if the "session" expires, since various web applications will have different sessions. Is it possible to withdraw a user from all web applications after a session in one of them?

2. I suspect (but not sure) that there may be some other session data on top of the authentication information that may be needed for sharing after sharing. What would be the best way to do this (again reliably and reliably)?

I found this article on passing identifiers (to database records that will contain shared data) and wondering if this is good.

All tips will be appreciated.

PS: I found several threads on SO here, but I don't think any of them answered these specific questions. I found this most useful:

Exchange data between ASP.NET applications

+7
source share
2 answers

In the end, I found a solution to this problem, and I leave it here as a link to others:

StateServer uses the Windows service (ASP.NET government service), which handles in-memory sessions. It uses MachineKey, AppDomainAppID, as well as SessionID to uniquely identify the application.

  • Set the same MachineKey in web.config so that it is the same for all applications under the site.
  • Add code to Global.asax Init () to set AppDomainAppID the same for all applications.
  • Implement ISessionIDManager and return a custom session identifier for reuse in sub-applications.

The following links provided information for the actual implementation that I did:

+11
source

You can split an ASP.NET session between different applications. Obviously, all applications using the same session state database must be in the same version of ASP.NET (in the version where the session state databases are compatible). In addition, all sharing applications will need to coordinate work with session state information. For example, a session variable must support compatible information and value between applications.

+2
source

All Articles