Ask the Expert

How can I share state between two Web applications?

I am using ASP.NET State Service for holding shared session data for many .NET Web applications as follows:

  1. Start ASP.NET State Service.
  2. Change session mode of Web.config file to StateServer and change stateConnectionString to "tcpip=127.0.0.1:42424."
  3. Restart IIS.

But I can not get the session data saved by Web application A from another (Web application B). Is there something wrong here? I am using IIS 5.0 on Win2000. Thank you very much for your help.
The problem is that in order to share state, both Web applications must point to the same state server, NOT 127.0.0.1, which is localhost. So you should have the stateConnectionString you specified in one machine, and in the other, something like: "tcpip=192.168.0.1:42424," of course with your machine A network address.

This was first published in June 2003

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: