Losing session variable across response.redirect in same folder

Discussion in 'ASP .Net' started by John, Apr 17, 2004.

  1. John

    John Guest

    Hi, I have a routine that sets some session variables and then redirects the
    user to another page in the same application/ same folder.

    =======
    Session("MyName") = "Fredsmith"
    Response.Redirect("./AnewPage.aspx")
    =======

    If I go, Response.Write(Session("MyName")) in the new page the session
    variable does not exist.

    I have all cookies enabled (session works for other pages) and understand
    redirecting across different domains clears session variables etc but this
    is a weird one!

    I have debugged right up until the Response.Redirect call and the session
    variable exists, it's the Redirect that is killing the session variable.

    Help appreciated
    Cheers
    Mark
    John, Apr 17, 2004
    #1
    1. Advertising

  2. John

    Sharon Guest

    did you chack, that the application is not restarting at this point, for
    some reason?
    in AnewPage.aspx, do you still get session vars stored by other pages?

    "John" <> wrote in message news:c5piaa$kcj$...
    > Hi, I have a routine that sets some session variables and then redirects

    the
    > user to another page in the same application/ same folder.
    >
    > =======
    > Session("MyName") = "Fredsmith"
    > Response.Redirect("./AnewPage.aspx")
    > =======
    >
    > If I go, Response.Write(Session("MyName")) in the new page the session
    > variable does not exist.
    >
    > I have all cookies enabled (session works for other pages) and understand
    > redirecting across different domains clears session variables etc but this
    > is a weird one!
    >
    > I have debugged right up until the Response.Redirect call and the session
    > variable exists, it's the Redirect that is killing the session variable.
    >
    > Help appreciated
    > Cheers
    > Mark
    >
    >
    >
    >
    Sharon, Apr 17, 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. Brad
    Replies:
    3
    Views:
    1,870
    Steven Cheng[MSFT]
    Feb 19, 2004
  2. Replies:
    2
    Views:
    501
  3. TCook
    Replies:
    3
    Views:
    11,818
    TCook
    Aug 15, 2006
  4. Sal
    Replies:
    1
    Views:
    406
  5. Jason C
    Replies:
    4
    Views:
    680
    Morty Abzug
    Jun 26, 2012
Loading...

Share This Page