new session created when changing pages

Discussion in 'ASP .Net' started by =?Utf-8?B?TXJHaWdhIChSb2JiIFNhZGxlcik=?=, May 30, 2005.

  1. I have a set of pages with C# code attached to manage session information.
    They hang their info off of the session string and store it in a MSDE table.
    I have all of this code working well in one app and started another app which
    needed much of the same functionality. So I copied the pages, code behinds,
    web.config and appropriate DB tables to the new app (all on localhost) and
    find that I am get redirected every time I login back to my login because
    ..IsNewSession always comes up true on the page after the login.

    Just in case I messed something up, I went back and checked my old pages and
    found that they were behaving fine. I double checked that the login was happy
    and creating the DB information, and it is. Asp.Net / IIS seems to just be
    creating a new session for every page I load in this second app.

    I am hoping that someone has a couple of pointers to save me having to take
    this app apart. I'm figuring I missed a setting somewhere, and I am pretty
    new at Asp.Net (I had been doing CGI and / or PHP up til 2004).

    TIA for any input!

    Robb Sadler
    =?Utf-8?B?TXJHaWdhIChSb2JiIFNhZGxlcik=?=, May 30, 2005
    #1
    1. Advertising

  2. OK, I have found a clue... I decided to try and add some info into the
    session data itself and so put in the line:

    System.Web.HttpContext.Current.Session.Add("zot", "zot");

    to add some information to the session when I first came upon it. I don't
    know why in my previous app I did not need to do this but in the current one
    it now returns with the same session when going to a new page (or refreshing
    the same one, etc).

    Is the session class assuming that I didn't use it since it's data had
    nothing added to it?

    At this point I have enough info to continue, but would love to get any
    comments.

    Thanks!

    Robb

    "MrGiga (Robb Sadler)" wrote:

    > I have a set of pages with C# code attached to manage session information.
    > They hang their info off of the session string and store it in a MSDE table.
    > I have all of this code working well in one app and started another app which
    > needed much of the same functionality. So I copied the pages, code behinds,
    > web.config and appropriate DB tables to the new app (all on localhost) and
    > find that I am get redirected every time I login back to my login because
    > .IsNewSession always comes up true on the page after the login.
    >
    > Just in case I messed something up, I went back and checked my old pages and
    > found that they were behaving fine. I double checked that the login was happy
    > and creating the DB information, and it is. Asp.Net / IIS seems to just be
    > creating a new session for every page I load in this second app.
    >
    > I am hoping that someone has a couple of pointers to save me having to take
    > this app apart. I'm figuring I missed a setting somewhere, and I am pretty
    > new at Asp.Net (I had been doing CGI and / or PHP up til 2004).
    >
    > TIA for any input!
    >
    > Robb Sadler
    =?Utf-8?B?TXJHaWdhIChSb2JiIFNhZGxlcik=?=, May 30, 2005
    #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?anBvcHBlcg==?=

    New session created when moving between asps and asp pages

    =?Utf-8?B?anBvcHBlcg==?=, Apr 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    363
    Cowboy \(Gregory A. Beamer\) [MVP]
    Apr 8, 2004
  2. Replies:
    1
    Views:
    351
    Alvin Bruney - ASP.NET MVP
    Nov 7, 2005
  3. PL
    Replies:
    2
    Views:
    3,174
  4. Replies:
    3
    Views:
    17,119
    zz78_gang
    Aug 17, 2007
  5. albertly
    Replies:
    3
    Views:
    14,041
    Steven Cheng[MSFT]
    Feb 8, 2008
Loading...

Share This Page