470,862 Members | 1,696 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,862 developers. It's quick & easy.

HttpApplication - Best event to work with Session & Cookies

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
Nov 3 '08 #1
3 1965
you want the PreRequestHandlerExecute event, it fires between load state and
process request.

-- bruce (sqlwork.com)
"Mike Gleason jr Couturier" wrote:
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
Nov 3 '08 #2

"bruce barker" <br*********@discussions.microsoft.coma écrit dans le
message de news: 39**********************************@microsoft.com...
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
Nov 3 '08 #3

"bruce barker" <br*********@discussions.microsoft.coma écrit dans le
message de news: 39**********************************@microsoft.com...
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!
Nov 4 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Joshua Beall | last post: by
14 posts views Thread by windandwaves | last post: by
29 posts views Thread by Patrick | last post: by
1 post views Thread by Kevin Frey | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.