Session State not carrying across assembly boundary

  • Thread starter Thread starter JezB
  • Start date Start date
J

JezB

I have various web pages in two different "web application" project
assemblies (WebClient1 and WebClient2), and another "class library" assembly
WebLib. I have methods in the library which set and read session variables.
However, I'm finding that if I set a session variable in a call from
WebClient1, I cannot read that session variable in a call from WebClient2.
Is this normal? What can I do about this ?
 
Yes it's normal. Sessions are per application - not per web server. So this
is normal behavior.

You will have to manage your own state (via sqlserver, as an example) if you
need different web applications to share data.
 
It's the same application, but my solution is split across two "projects". I
think I need to play about with Web.Config ...
 
That's what Marina was implying - you can't share a session variable accross
projects. You will need to store/persist the data in another way, like
storing the data in SQL Server and reading it as the user enters the new
application.

mark
www.dovetaildatabases.com
 
A solution is just a way to group projects - it doesn't mean it's one
application. Conceptually, to you, it is one application. But as far as IIS
is concerned, it is two applications that have no connection.

VS.NET creates a different web application for each web project - they each
have their own virtual directory, and thus each is a separate web
application.
 
Back
Top