What you describe looks like a single application that
you have unnecessarily broken into two different parts.
Basically, you should not run your modules as separate
applications, but as subdirectories of your main application.
You need to review, carefully, the process described
in this KB, to see if you are setting up your project
in a way which will allow sharing session information :
http://support.microsoft.com/default...b;en-us;307467
Alternately, you might want to consider not using the built-in session
and application objects and, instead, writing your own classes and
exposing the properties you need, serializing to/from XML,
as Samuel Matzen suggests :
http://searchvb.techtarget.com/vsnet...293672,00.html
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaņol
Ven, y hablemos de ASP.NET...
======================
"Logickle" <Logickle.1ns4ht@mail.codecomments.com> wrote in message
news:Logickle.1ns4ht@mail.codecomments.com...[color=blue]
>
> Hi, all. I'm working on an application which requires communicating
> session info between separate web apps running on the same web server.
>
>
> The out of process server method sounded ideal, and very simple to
> implement as far as I could tell. So I re-configured my apps'
> web.config and machine.config files from InProc to StateServer, and
> confirmed that's the mode used by both web apps.
>
> To keep it simple, I created two basic ASP.NET apps Test1 and Test2,
> and added enough code to (1) insert string session variables at session
> start, and (2) read those variables at page load.
>
> Also, in Test1 I added a button which redirects to Test2.
>
> The problem is that the only session variable each can see is the one
> *it* set. It doesn't see the variable set by the other - no error is
> thrown, but reading the other's session variable returns an empty
> string. As I understand it the point of the state server method is to
> enable different processes to share session info, but even in this
> simple code these processes can't see each others' data.
>
> Any ideas what I'm doing wrong?? Thanks in advance!
>
> Here's the specific code from my web apps:
>
> Test1 -
> ========
>
> Global.asx.vb:
> --------------
> Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
> ' Fires when the session is started
> Session("test1") = "test1"
> End Sub
>
> webform1.aspx.vb:
> --------------
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> Response.Write("Test1")
> Response.Write("Session1: " & Session("test1"))
> Response.Write("Session2: " & Session("test2"))
> Response.Write("Mode: " & Session.Mode())
> End Sub
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Response.Redirect("http://localhost/Test2/WebForm1.aspx")
> End Sub
>
> Test2 -
> ========
>
> Global.asx.vb:
> --------------
> Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
> ' Fires when the session is started
> Session("test2") = "test2"
> End Sub
>
> webform1.aspx.vb:
> --------------
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Response.Write("Test2")
> Response.Write("Session1: " & Session("test1"))
> Response.Write("Session2: " & Session("test2"))
> Response.Write("Mode: " & Session.Mode())
> End Sub
>
>
>
> --
> Logickle[/color]