Session State not carrying across assembly boundary

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 ?
 
M

Marina

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.
 
J

JezB

It's the same application, but my solution is split across two "projects". I
think I need to play about with Web.Config ...
 
M

Mark

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
 
M

Marina

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top