Old question but not finished yet : sessions

N

Nick Wouters

Dear all

I sended this reply to my first issue a few days ago... please help!!!
-----------------------------------------------------------------------------

correct,

but when I am using this session in another ASP.net project on the SAME
server , the session is empty
It seems sessions are lost when you redirect to another page on the same
server but within another project in the SAME solution.

Sounds strange to me, I always thought session were kept on the server,
perhaps I could try to save my sessions in an sql database, but is it
possible for objects like an instance of a class?

Hope someone can help me out!

Best regards

Nick Wouters
Belgium newbie
 
S

ScottStoecker

Session variables are only valid for one web application. So if your
directory structure looked like this:

c:\wwwroot\InetPub
--------- Application 1
bin
---------- Application 2
bin

A session in Application 1 can only be used in the Application 1 web
app, and Application 2 (regardless of whether it is part of the same
solution) cannot see it. If you want to share Session data, you will
either have to persist the data in some location, or you could send the
data via a QueryString variable between directories:

(In Application 1):
<a
href="http://localhost/Application2/GetVariable.aspx?SessionVar=hello">Send</a>

(In Application 2, this code would be in a file named
GetVariable.aspx):
Dim App1SessionVariable As String = Request.QueryString("SessionVar")

There may be other methods as well. Hope that helps.

Scott
 

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

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,828
Latest member
LauraCastr

Latest Threads

Top