Response.Redirect from Application_Error - session changes lost

Discussion in 'ASP .Net' started by Jon Paugh, Nov 30, 2004.

  1. Jon Paugh

    Jon Paugh Guest

    Hi,

    So in Application_Error method in Global class of my
    ASP.NET web project, I add:

    HttpContext.Current.Session["SomeSessionThing"]
    = "SomeSessionThing";

    Then, in Application_Error method I Response.Redirect to
    a error page. In the page's load, I check the value of

    HttpContext.Current.Session["SomeSessionThing"]

    and it now returns null.

    What is going on here? I thought session would always be
    preserved no matter what? I am using out of proc session
    option.

    Thanks,

    Jon
    Jon Paugh, Nov 30, 2004
    #1
    1. Advertising

  2. Jon Paugh

    Jon Paugh Guest

    Ok, I get to answer my own question. Are you ready? The
    super secret technique for persisting session in
    Application_Error,:

    just call

    Server.ClearError();


    >-----Original Message-----
    >Hi,
    >
    >So in Application_Error method in Global class of my
    >ASP.NET web project, I add:
    >
    >HttpContext.Current.Session["SomeSessionThing"]
    >= "SomeSessionThing";
    >
    >Then, in Application_Error method I Response.Redirect

    to
    >a error page. In the page's load, I check the value of
    >
    >HttpContext.Current.Session["SomeSessionThing"]
    >
    >and it now returns null.
    >
    >What is going on here? I thought session would always be
    >preserved no matter what? I am using out of proc session
    >option.
    >
    >Thanks,
    >
    >Jon
    >.
    >
    Jon Paugh, Nov 30, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,234
    Srowe1975
    Oct 15, 2008
  2. Replies:
    2
    Views:
    7,475
  3. Sal
    Replies:
    1
    Views:
    406
  4. Alex
    Replies:
    2
    Views:
    138
    Guest
    Oct 20, 2003
  5. Dornel
    Replies:
    0
    Views:
    157
    Dornel
    Jun 14, 2006
Loading...

Share This Page