HttpApplication - Best event to work with Session & Cookies

  • Thread starter Mike Gleason jr Couturier
  • Start date
M

Mike Gleason jr Couturier

Hi,

When a user log itself in my web site, I set a cookie.
When the use come back after, let's say, a day, I check the cookie and set a
value in the user's Session (If the cookie exists). I also update the
cookie.

I need to do this before the page gets processed.

Where in the application chain would you put this piece of code (the part
where it manipulates the cookies and the session)

Thanks !

Mike
 
B

bruce barker

you want the PreRequestHandlerExecute event, it fires between load state and
process request.

-- bruce (sqlwork.com)
 
M

Mike Gleason jr Couturier

bruce barker said:
you want the PreRequestHandlerExecute event, it fires between load state
and
process request.

It's weird, it seems I already tried it. But I remembered that It made my
AJAX JavaScript failed and my CSS failed when loading the page...

I'll retry tonight when back home, thanks!

Mike
 
M

Mike Gleason jr Couturier

bruce barker said:
you want the PreRequestHandlerExecute event, it fires between load state
and
process request.

Cool everything's working fine....

I made a javascript error that caused all the site to break because I was
setting my cookie via a RegisterstartupScript (It seems AJAX asynch postback
doesn't parse cookie headers).

Thanks!
 

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,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top