Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Session variables are lost

Reply
Thread Tools

Session variables are lost

 
 
Nils Erik Dall
Guest
Posts: n/a
 
      09-19-2006
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
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-19-2006
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.


 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      09-19-2006
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" <(E-Mail Removed)> a écrit dans le message de news:
efBAby%(E-Mail Removed)...
> 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



 
Reply With Quote
 
Nils Erik Dall
Guest
Posts: n/a
 
      09-19-2006
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
 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-19-2006
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.


 
Reply With Quote
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      09-19-2006
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" <(E-Mail Removed)> wrote in message
news:efBAby%(E-Mail Removed)...
> 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



 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      09-19-2006
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" <(E-Mail Removed)> a écrit dans le message de news:
eQ$G2Y$(E-Mail Removed)...
> 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



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-19-2006
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" <(E-Mail Removed)> a écrit dans le message de news:
> eQ$G2Y$(E-Mail Removed)...
>> 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.


 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      09-19-2006

"Cowboy (Gregory A. Beamer)" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:efBAby%(E-Mail Removed)...
> > 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

>
>



 
Reply With Quote
 
Nils Erik Dall
Guest
Posts: n/a
 
      09-19-2006
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...
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Variables work from Page1 to Page2 / lost from Page2 to Page3 P. Prosper ASP .Net 2 08-26-2005 02:31 PM
Session variables are lost Guns ASP .Net 2 07-16-2005 11:06 AM
RE: Lost Session Variables =?Utf-8?B?TWljaGFlbCBTTA==?= ASP .Net 3 02-26-2004 03:51 PM
Lost session variables - size issue? Eliyahu Goldin ASP .Net 1 01-14-2004 04:27 AM
Session Variables lost between pages gupta ASP .Net 1 11-06-2003 03:40 AM



Advertisments