How to deal with the problem of common session of different Web applications in a site in asp.net

Source: Internet
Author: User
Tags config
asp.net|session|web| Problem | How to deal with the problem of common session of different Web applications in site asp.net

1, the problem description:

There are four M1,M2,M3,M4 modules in system S, each of which is a Web application. The session is not readable in another module after the session is set in one of the modules.

2, the problem reason:

A Web application is the equivalent of a site, and it is impossible to share sessions between applications and applications.

3, the solution:

1 include four Web applications in the same solution, as shown in the figure:




The actual directory storage structure is as follows:



(Note: Adjust the. webinfo file to make the solution work properly)

2 Create a new Web application main, which is contained in solution s and stored directly in the S directory (that is, corresponds to the virtual directory s).

3 Add the other four references to the main application, as shown in the figure:




4 Rebuild the main application, at which point the DLL for the M1, M2, M3, M4 four modules associated with the main module will be generated in the S\bin directory.

5) Adjust Web.config file

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

The following actions affect the development environment

6) Delete Goble.acax

Delete the Goble.acax files in the M1, M2, M3, M4 four modules.

7 Delete M1, M2, M3, M4 four modules corresponding to the virtual directory

8) Done

Today encountered this problem for half a day, time relationship, write very concise. Initial dispatch, hope this article is helpful to everybody.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.