473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using StateServer to share Session across two Web Applications

2 New Member
I am trying to use Session and StateServer to store values to be used by two different Web Applications, which run on the same IIS, in different Virtual Directories.

I have StateServer running on another machine (192.168.0.1). I have set the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\aspnet_state\Parameters\AllowRemoteConnection to 1.

I create two Web Projects in Visual Studio: Redirect and Receive.
Redirect has a Default.aspx which contains a button, and here is the click handler:

protected void Button1_Click(object sender, EventArgs e)
{
Session["Test"] = "Test";
Response.Redirect("http://localhost/Receive");
}

Receive has a Default.aspx which contains a label. Here is its Load event handler:

protected void Page_Load(object sender, EventArgs e)
{
this.LabelTest.Text = Session["Test"] as string;
}

Both Web Application have the same Web.config:

<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<sessionState mode="StateServer" cookieless="true" timeout="20" stateConnectionString="tcpip=192.168.0.1:42424"/>
<compilation debug="true" />
<authentication mode="Windows" />
</system.web>
</configuration>

As I mentioned, there are two virtual directories off of the Default Web Site in IIS: they map to http://localhost/Redirect and http://localhost/Receive. When i browse to http://localhost/Redirect and click the button, it goes to http://localhost/Receive but the lable text is empty.

Any idea on what I'm doing wrong here?
Sep 6 '07 #1
2 3375
Plater
7,872 Recognized Expert Expert
You have to do something fancy with the web.config files I think.
Something about registering a globalID so that the Session can be shared.
I've never done it, only remember reading about it in here somewhere.

I think Friny knows more about this but she has been absent as of late I think.
Sep 6 '07 #2
metafedora
2 New Member
After searching for a solution, I've starting to see an indication that this may in fact not be possible, since Virtual Directories result in separate App Domains, and these are used to generate unique ApplicationID's. There is a way around this, and my colleague has blogged about it. So I am going to abandon StateServer and go with a SQLServer-based Session persistance.
Sep 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: George Hester | last post by:
In one Application (2) the client is redirected to a Logon ASP in a different Application (1). A Session Variable is made in Application 2 which needs to be recognized in Application 1. Can I do...
2
by: TaeHo Yoo | last post by:
Hi all, I have a solution which contains multiple projects. Those multiple projects should share the same session. For example, users login, create the session for users then these session...
4
by: Lerp | last post by:
Hi all, I have been asked to build a common login for a cluster of web apps, is it possible to use stateserver to handle/manage session state across more than one web application? Cheers, Lerp
8
by: GeekBoy | last post by:
I understand the benefit of pushing the StateServer process onto another computer to "balance" the load and take some cpu and memory usage off the web server, but how much could it possibly help?...
3
by: Justin | last post by:
I am using a 3rd party ecommerce application writen in VB.NET. I have developed a couple c# addons that I would like to integrate into the ecommerce site, more specifically I need to share session...
3
by: masoud bayan | last post by:
Hi, We have 3 different web applications on three different websites (and domains). Now we want to make it possible for users to login in each of these applications and can navigate to other...
1
by: guoqi zheng | last post by:
I have an application in IIS with a few sub domains assign to it. Is there a way for me to share session data across those subdomains? regards, Guoqi Zheng http://www.ureader.com
6
by: tshad | last post by:
I switched my site from InProc to StateServer a while ago which solve a problem I was having dropping my session cookies when the worker process recycles. This has been working well until today....
13
by: Goofy | last post by:
Does anyone know how I can kill a session by session ID ? -- Goofy
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.