Problem with Sessions and Redirects
Problem with Sessions and Redirects
am 02.01.2008 16:27:26 von geocar
Hello.
I have a system using WebAssist on a up-to-date Windows 2003 server
(R2) where the symptoms are that I get multiple ASPSESSIONID cookies
(from multiple processes), and thus my Session() variables are
unusable.
I've narrowed it down to the following; if I use Server.Transfer
instead of Response.Redirect the problem doesn't occur. If I disable
multiprocessing (and set number of processes for the application=1)
then the problem doesn't occur. Obviously I don't want to do either of
these things, but I cannot find any documentation that suggests this
behavior is normal, nor how to fix it.
I have packet-traces that demonstrate that the browser is doing the
right thing (sending the cookie back during the redirect). I can even
set-up a smaller test-case that doesn't involve using WebAssist but
simply changes Session("k")=Session.SessionID and then redirects to a
page that tries to compare Session.SessionID and Session("k") -- this
is obviously a race condition. Sometimes it works, and sometimes it
fails. It usually fails at least once within a dozen tries (with a
null-set of cookies starting each try).
The event-log doesn't yield anything interesting when this occurs, and
I do not know where to look for more information.
Where can I find out what exactly is going on, and how can I fix it?
Please Cc me as while I'm trying to monitor the group, I don't know
how well that works yet.
If I'm asking this question on the wrong group, I apologize, and would
appreciate being directed to the correct group.
Re: Problem with Sessions and Redirects
am 02.01.2008 23:39:23 von Anthony Jones
"geocar" wrote in message
news:bc2a0dee-4f83-414d-8a9e-332b0d3009cb@v32g2000hsa.google groups.com...
> Hello.
>
> I have a system using WebAssist on a up-to-date Windows 2003 server
> (R2) where the symptoms are that I get multiple ASPSESSIONID cookies
> (from multiple processes), and thus my Session() variables are
> unusable.
>
> I've narrowed it down to the following; if I use Server.Transfer
> instead of Response.Redirect the problem doesn't occur. If I disable
> multiprocessing (and set number of processes for the application=1)
> then the problem doesn't occur. Obviously I don't want to do either of
> these things, but I cannot find any documentation that suggests this
> behavior is normal, nor how to fix it.
>
> I have packet-traces that demonstrate that the browser is doing the
> right thing (sending the cookie back during the redirect). I can even
> set-up a smaller test-case that doesn't involve using WebAssist but
> simply changes Session("k")=Session.SessionID and then redirects to a
> page that tries to compare Session.SessionID and Session("k") -- this
> is obviously a race condition. Sometimes it works, and sometimes it
> fails. It usually fails at least once within a dozen tries (with a
> null-set of cookies starting each try).
>
> The event-log doesn't yield anything interesting when this occurs, and
> I do not know where to look for more information.
>
> Where can I find out what exactly is going on, and how can I fix it?
>
> Please Cc me as while I'm trying to monitor the group, I don't know
> how well that works yet.
>
> If I'm asking this question on the wrong group, I apologize, and would
> appreciate being directed to the correct group.
Use of a ASP session object is limited to a single process. If you've got
something which farming requests to different processes but isn't able to
affiliate the client browser session with a single process then you simply
can't use the ASP Session object effectively.
I'm not familiar with WebAssist so I can't advise you futher, what is
WebAssist?
--
Anthony Jones - MVP ASP/ASP.NET
Re: Problem with Sessions and Redirects
am 03.01.2008 00:25:18 von geocar
On Jan 2, 5:39 pm, "Anthony Jones" wrote:
> "geocar" wrote in message
>
> news:bc2a0dee-4f83-414d-8a9e-332b0d3009cb@v32g2000hsa.google groups.com...
>
>
>
> > Hello.
>
> > I have a system using WebAssist on a up-to-date Windows 2003 server
> > (R2) where the symptoms are that I get multiple ASPSESSIONID cookies
> > (from multiple processes), and thus my Session() variables are
> > unusable.
>
> > I've narrowed it down to the following; if I use Server.Transfer
> > instead of Response.Redirect the problem doesn't occur. If I disable
> > multiprocessing (and set number of processes for the application=1)
> > then the problem doesn't occur. Obviously I don't want to do either of
> > these things, but I cannot find any documentation that suggests this
> > behavior is normal, nor how to fix it.
>
> > I have packet-traces that demonstrate that the browser is doing the
> > right thing (sending the cookie back during the redirect). I can even
> > set-up a smaller test-case that doesn't involve using WebAssist but
> > simply changes Session("k")=Session.SessionID and then redirects to a
> > page that tries to compare Session.SessionID and Session("k") -- this
> > is obviously a race condition. Sometimes it works, and sometimes it
> > fails. It usually fails at least once within a dozen tries (with a
> > null-set of cookies starting each try).
>
> > The event-log doesn't yield anything interesting when this occurs, and
> > I do not know where to look for more information.
>
> > Where can I find out what exactly is going on, and how can I fix it?
>
> > Please Cc me as while I'm trying to monitor the group, I don't know
> > how well that works yet.
>
> > If I'm asking this question on the wrong group, I apologize, and would
> > appreciate being directed to the correct group.
>
> Use of a ASP session object is limited to a single process. If you've got
> something which farming requests to different processes but isn't able to
> affiliate the client browser session with a single process then you simply
> can't use the ASP Session object effectively.
I don't know how to control which application process runs the asp
files. As far as I understood, the application pool handled that
detail. Is this wrong?
If it is, how do I get client affinity? Can you direct me at a guide
for figuring this out? What happens if the process was recycled? Does
the session database simply disappear?
This is a single, standalone server. There is no farm of machines
involved here. Does this really mean that if the Web garden/Maximum
number of worker processes is not equal to 1 that "classic" ASP's
Session variable is unusable?
> I'm not familiar with WebAssist so I can't advise you futher, what is
> WebAssist?
Unfortunately, neither am I, unfortunately. We simply have a client-in-
common. They're a set of Dreamweaver plugins that enable various point/
click features like form delivery, shopping carts, etc.
Re: Problem with Sessions and Redirects
am 03.01.2008 12:18:37 von Anthony Jones
"geocar" wrote in message
news:64e46300-aac4-41df-acab-76647acdde9a@i12g2000prf.google groups.com...
> On Jan 2, 5:39 pm, "Anthony Jones" wrote:
> > "geocar" wrote in message
> >
> >
news:bc2a0dee-4f83-414d-8a9e-332b0d3009cb@v32g2000hsa.google groups.com...
> >
> >
> >
> > > Hello.
> >
> > > I have a system using WebAssist on a up-to-date Windows 2003 server
> > > (R2) where the symptoms are that I get multiple ASPSESSIONID cookies
> > > (from multiple processes), and thus my Session() variables are
> > > unusable.
> >
> > > I've narrowed it down to the following; if I use Server.Transfer
> > > instead of Response.Redirect the problem doesn't occur. If I disable
> > > multiprocessing (and set number of processes for the application=1)
> > > then the problem doesn't occur. Obviously I don't want to do either of
> > > these things, but I cannot find any documentation that suggests this
> > > behavior is normal, nor how to fix it.
> >
> > > I have packet-traces that demonstrate that the browser is doing the
> > > right thing (sending the cookie back during the redirect). I can even
> > > set-up a smaller test-case that doesn't involve using WebAssist but
> > > simply changes Session("k")=Session.SessionID and then redirects to a
> > > page that tries to compare Session.SessionID and Session("k") -- this
> > > is obviously a race condition. Sometimes it works, and sometimes it
> > > fails. It usually fails at least once within a dozen tries (with a
> > > null-set of cookies starting each try).
> >
> > > The event-log doesn't yield anything interesting when this occurs, and
> > > I do not know where to look for more information.
> >
> > > Where can I find out what exactly is going on, and how can I fix it?
> >
> > > Please Cc me as while I'm trying to monitor the group, I don't know
> > > how well that works yet.
> >
> > > If I'm asking this question on the wrong group, I apologize, and would
> > > appreciate being directed to the correct group.
> >
> > Use of a ASP session object is limited to a single process. If you've
got
> > something which farming requests to different processes but isn't able
to
> > affiliate the client browser session with a single process then you
simply
> > can't use the ASP Session object effectively.
>
> I don't know how to control which application process runs the asp
> files. As far as I understood, the application pool handled that
> detail. Is this wrong?
>
> If it is, how do I get client affinity? Can you direct me at a guide
> for figuring this out? What happens if the process was recycled? Does
> the session database simply disappear?
>
> This is a single, standalone server. There is no farm of machines
> involved here. Does this really mean that if the Web garden/Maximum
> number of worker processes is not equal to 1 that "classic" ASP's
> Session variable is unusable?
>
> > I'm not familiar with WebAssist so I can't advise you futher, what is
> > WebAssist?
>
> Unfortunately, neither am I, unfortunately. We simply have a client-in-
> common. They're a set of Dreamweaver plugins that enable various point/
> click features like form delivery, shopping carts, etc.
Sorry I was switched off for some reason (blinded by WebAssist reference).
The use of a Web Garden is not compatible with storing state in an ASP
Session object.
http://support.microsoft.com/?id=822171
--
Anthony Jones - MVP ASP/ASP.NET
Re: Problem with Sessions and Redirects
am 03.01.2008 18:38:28 von geocar
On Jan 3, 6:18 am, "Anthony Jones" wrote:
> Sorry I was switched off for some reason (blinded by WebAssist reference).
>
> The use of a Web Garden is not compatible with storing state in an ASP
> Session object.
>
> http://support.microsoft.com/?id=822171
Thanks! That's what I needed!