Start ASP.NET State Service.
Changed session mode of Web.config file to StateServer
Changed stateConnectionString to Both Web applications are pointing to the localhost state server.
Still, it's not working. To check, I set the session in one Web.spplication, and then I tried to access the session variable from another Web application. If not, is there any other way to share session data between different Web applications?
I quit using the built-in session and application state many months ago. In my current applications I create a class containing all of my session state declarations and expose them as properties. When a page loads I create an instance of this session state object and load its contents from an XML file in the file system. Then when the page closes I serialize the values back to XML and write them back to the file system.
This has a number of advantages:
1. Your session state members are strong typed and strong named.
2. All of your session state is in one place and explicitly defined. It is extremely difficult to keep track of session state variables when they are named with literal constants.
3. You can write the session state XML files to a shared system, thus the session state is available not only to multiple applications, but also across multiple servers.
This was first published in October 2004