Session variables are lost

N

Nils Erik Dall

Hi All

I have a problem with my asp code on an iis 6.0 server on windows 2003
web. When I redirect between to asp pages on my web-site, where pageA is
in a different virtual directory from pageB the session variables value
a lost. I know that it is the session ID there increases. (New session).
If I make the same call in the same virtual directory the session
variables is not lost. Is it some thing about different application
pools? If sow, how can I join two or more application pools regarding
to session variables? If not is there a none coding work around.

N Dall
 
B

Bob Barrows [MVP]

Nils said:
Hi All

I have a problem with my asp code on an iis 6.0 server on windows 2003
web. When I redirect between to asp pages on my web-site, where pageA
is in a different virtual directory from pageB the session variables
value a lost. I know that it is the session ID there increases. (New
session). If I make the same call in the same virtual directory
the session variables is not lost. Is it some thing about different
application pools?

Sort of. Multiple applications can (and usually do) use the same
application pool.

The different virtual directories are also different applications. Look
at their properties in IIS Manager to see this.

Sessions are application-specific.
If sow, how can I join two or more application
pools regarding to session variables?

There is no way that I know of
If not is there a none coding
work around.
You will need to create your own session-state manager, perhaps using a
database to store session settings for each user.
 
P

Patrice

Double check this is the same web application ? If you defined an
application at the root of each vdir this is expected as you are then in two
different applications...
 
N

Nils Erik Dall

Patrice said:
Double check this is the same web application ? If you defined an
application at the root of each vdir this is expected as you are then in two
different applications...
Hi all

Thanks for the replays.

The examples mention are inside the same website.
e.g. http://webserver/testa/pagea.asp >>
http://webserver/testb/pageb.asp will lose it’s session variable if
“testa” is a virtual directory or/and “testb” is a virtual directory.

In the example “testa” and “testb” are in the default application pool.
My question is to be precise. Can I get “testa” and “testb” to use the
same session variable as the website?

N Dall
 
B

Bob Barrows [MVP]

Nils said:
Hi all

Thanks for the replays.

The examples mention are inside the same website.
e.g. http://webserver/testa/pagea.asp >>
http://webserver/testb/pageb.asp will lose it’s session variable if
“testa” is a virtual directory or/and “testb” is a virtual directory.

In the example “testa” and “testb” are in the default application
pool. My question is to be precise. Can I get “testa” and “testb” to
use the same session variable as the website?
Nothing you have said changes my previous reply.
 
C

Cowboy \(Gregory A. Beamer\)

testa = one virtual directory
testb = another virtual directory

They are not the same app, even if in the same pool.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 
P

Patrice

Yes you can if you don't want specifically those two vdirs to be in two
distincts applications. The boundary for a session is the web application,
not the "web site".

See the properties for these directories, "Virtual Directories" tab and
"Application Settings" section. If you have defined applications on these
directories (and it looks you have as you said that they are using the same
pool, if they are not applications you can't define anyway separately in
which pool they are), this is two different applications and they have as
such each their own session.

If they are really part of the same application, you should use then the
"Remove" button to delete those applications (after a bit of thinking in
case the previous setting would have been done for some reason). Those vdir
will then be part of the same parent application and will share then the
same session...
 
B

Bob Barrows [MVP]

Patrice said:
Yes you can if you don't want specifically those two vdirs to be in
two distincts applications. The boundary for a session is the web
application, not the "web site".

See the properties for these directories, "Virtual Directories" tab
and "Application Settings" section. If you have defined applications
on these directories (and it looks you have as you said that they are
using the same pool, if they are not applications you can't define
anyway separately in which pool they are), this is two different
applications and they have as such each their own session.

If they are really part of the same application, you should use then
the "Remove" button to delete those applications (after a bit of
thinking in case the previous setting would have been done for some
reason). Those vdir will then be part of the same parent application
and will share then the same session...
 
A

Anthony Jones

Cowboy (Gregory A. Beamer) said:
testa = one virtual directory
testb = another virtual directory

They are not the same app, even if in the same pool.

There is a little ambiguity here.

testa and testb can both be virtual directory yet be part of the same app
and share session data. I suspect in Nils case these virtual direcories
would be also be marked as apps. In this open the directory properties and
click remove on the home directory tab.
 
N

Nils Erik Dall

Hi All

Thanks you all for the help. It was when I created the virtual directory
in IIS manager, with script access, the IIS manager also make an
individual application pool for the virtual directory in the as
DefaultAppPool. The only ting I have to do what do remove the
application pool again and it will use the default application pool for
the web-site and my session variables are again global on the web-site.

N Dall
 
A

Anthony Jones

Nils Erik Dall said:
Hi All

Thanks you all for the help. It was when I created the virtual directory
in IIS manager, with script access, the IIS manager also make an
individual application pool for the virtual directory in the as
DefaultAppPool. The only ting I have to do what do remove the
application pool again and it will use the default application pool for
the web-site and my session variables are again global on the web-site.

Ok just to be clear 'Application pool' and 'Application' are different
things. Two different applications running in the same pool will not share
the same session data and it is not possible to run scripts from a single
application in two different application pools.

What you have done is removed the _Application_, IOW you have stopped the
virtual folder from acting as a seperate application. It therefore becomes
part of the parents application. Application pools in this case are
irrelevant.
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top