ASP.net addresses the problem of sharing Session between different Web applications on one site

  • 2020-05-05 11:10:01
  • OfStack

1. Problem description:

      system S M1, M2, M3, M4 four modules, each module is a web application. After Session is set in one module, it cannot be read in other modules.

2. Reason for the problem:

An WEB application is equivalent to a site, and it is impossible to share Session between applications.

3. Solution:

1)   includes four web applications in the same solution

(note: adjust the.webinfo file to make the solution work)

2) create a new web application Main, which is included in the solution S and stored directly in the S directory (that is, corresponding to the virtual directory S).

3) add references to

for the other four applications in the Main application

4) rebuild Main application. At this point, dll of M1, M2, M3 and M4 related to Main module will be generated in S\bin directory.

5) adjust web.config file

Delete all sections in web. config except section AppSetting in the four modules M1, M2, M3 and M4 except section AppSetting. (you can also delete the web.config in the four modules and keep only the web.config files in the S directory.)

The following will affect the development environment

6) delete goble.acax

Delete goble.acax files in M1, M2, M3 and M4 modules.

7) delete the virtual directory

corresponding to M1, M2, M3, M4

8)

completed

Related articles: