By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,078 Members | 1,846 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,078 IT Pros & Developers. It's quick & easy.

Session variables are lost

P: n/a
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
Sep 19 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Nils Erik Dall wrote:
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.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Sep 19 '06 #2

P: n/a
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...

--
Patrice

"Nils Erik Dall" <da**@garudahr.coma écrit dans le message de news:
ef***************@TK2MSFTNGP02.phx.gbl...
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

Sep 19 '06 #3

P: n/a
Patrice wrote:
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
Sep 19 '06 #4

P: n/a
Nils Erik Dall wrote:
Patrice wrote:
>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?
Nothing you have said changes my previous reply.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Sep 19 '06 #5

P: n/a
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!
*************************************************
"Nils Erik Dall" <da**@garudahr.comwrote in message
news:ef***************@TK2MSFTNGP02.phx.gbl...
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

Sep 19 '06 #6

P: n/a
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...

--
Patrice

"Nils Erik Dall" <da**@garudahr.coma écrit dans le message de news:
eQ**************@TK2MSFTNGP04.phx.gbl...
Patrice wrote:
>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

Sep 19 '06 #7

P: n/a
Patrice wrote:
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...

--
Patrice

"Nils Erik Dall" <da**@garudahr.coma écrit dans le message de news:
eQ**************@TK2MSFTNGP04.phx.gbl...
>Patrice wrote:
>>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
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Sep 19 '06 #8

P: n/a

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:Oj**************@TK2MSFTNGP05.phx.gbl...
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.

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

*************************************************
Think outside of the box!
*************************************************
"Nils Erik Dall" <da**@garudahr.comwrote in message
news:ef***************@TK2MSFTNGP02.phx.gbl...
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


Sep 19 '06 #9

P: n/a
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

Patrice wrote:
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...
Sep 19 '06 #10

P: n/a

"Nils Erik Dall" <da**@garudahr.comwrote in message
news:%2******************@TK2MSFTNGP05.phx.gbl...
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.
>
N Dall

Patrice wrote:
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...

Sep 20 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.