IHttpHandler, ProcessRequest and Session

C

Chance Hopkins

I've got the IRequiresSessionState interface implemented, but because of
forms authentication my page fires twice and causes certain session
functions to update twice which messes up my values.

Is there anyway to keep ProcessRequest from firing twice, or detect if it
has fired once and not call certain functions in the page again on the
second time through?
 
T

Teemu Keiski

Hi,
because of forms authentication my page fires twice

What do you mean with this? Can you elaborate a bit? Do you have some custom
authentication in use with Forms authentication (or just that page gts
executed twice for a good reason?).
 
C

Chance Hopkins

Teemu Keiski said:
Hi,


What do you mean with this? Can you elaborate a bit? Do you have some
custom authentication in use with Forms authentication (or just that page
gts executed twice for a good reason?).

I was refering to this thread:

http://tinyurl.com/66lm8

I'm experiencing the same thing. I make a handler and create a page that is
made in csharp.
All events in the page class fire twice, and I'm assuming that is due to the
comment in the link above.
Everything else works fine, that page displays, events that I wire up in
controls fire and all is great.

Except session variables end up getting set twice. So:

Session("item1") = Session("item1") + somevalue

ends up happending twice and I get

Session("item1") = Session("item1") + somevalue + somevalue

I wondering if anyone else might have a convenient "global" work around for
this. I've run into a wall, as I've been working on it for three days now.
 
T

Teemu Keiski

Hmm...can you try getting past it with checking Request.IsAuthenticated (or
does it return Ture in your case for the very first request)?
 
C

Chance Hopkins

Teemu Keiski said:
Hmm...can you try getting past it with checking Request.IsAuthenticated
(or does it return Ture in your case for the very first request)?

Good thinking, but it looks like it returns true both times.

I also just tried setting this in web.config

<pages autoEventWireup="false" />

as discribed in this article:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;317690

I heard that fired events twice sometimes, although I'm working in csharp.

I may end up having to figure out a different way to pass this value around.
It would be nice to be able to figure out a work around though, for the
future.
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top