Having two ASP.NET projects share a single Session

  • Thread starter Thread starter AARON PECORARO
  • Start date Start date
A

AARON PECORARO

I need to split apart my web application into multiple projects to allow it
to be distributed in parts, but all of the projects need to work together
(ie. they need to share session information). Does anyone have any
suggestions or solutions to this problem?

Thanks,
Richard Bowman
 
From what I can see when developing in VB.NET, each project represents
a single assembly, and each VB-based ASP.NET Web Application project
represents its own application, running in its own application space
in IIS. As such, the session information is being maintainted at the
application level, and one web application's session is not the same
as anothers.

How would I go about developing two seperate assemblies that function
inside the same project(application) space?

Richard
 
In VS .NET you can have 2 or more projects (assemblies) comprise 1 solution
by opening one project and choosing File...Add Project. You'll still have 2
assemblies, but they can interact for 1 solution. This is similar to the
Visual Basic 6 Project Group concept.

You are correct in thinking that having multiple assemblies running causes
them to run in different processes, but (AFAIK) that is not where the
session data would be stored.

Here's a simple test you can do to see:

Create 2 different ASP .NET projects.
In each project place the following code into the Page_Load event of the
page that is automatically generated for you (WebForm1.aspx):

response.write (session.sessionID)

Run one of the pages and look at the ID.
Type in the address of the other page and look at the ID again.

They should be the same and if they are, session data can be passed between
them.
 
Solutions are exactly no more than a project group, a logical grouping
of individual projects which still function autonomously. Much like
projects in the same solution still need to have explicit references
to each other, ASP.NET Web Projects (in the same solution or not) are
definitely seperated from each other. Each project, as I've mentioned
earlier, runs in its own IIS application space and does not share
session data, no matter the solution they are present in.

What I need is a solution to this problem that allows multiple
projects to share a session. I can't imagine I am the only person who
has run into this; it seems preposterous to assume that enourmous
websites must be managed in a single application.
 
Back
Top