SessionId-Problem - New in VS2005 - Each browser child window is a new session

Discussion in 'ASP .Net' started by Rolf Welskes, Oct 8, 2006.

  1. Rolf Welskes

    Rolf Welskes Guest

    Hello,

    the following sample application in ASp.net 2.0 / VS2005 (Webproject).

    in an testPage.aspx

    ................

    <P><A href="01Test01A.aspx">Link to 01Test01 A</A></P>
    <P><A href="01Test01B.aspx">Link to 01Test01 B</A></P>


    Now start the page.

    Now DO NOT click on the link, but right click on the first link and select
    'In new window'.
    Now right click on the second link and select 'In new Window'.

    Now you have 3 internet browser pages visible.

    All three are the same application.
    All three are from the same user (session).

    but if you check the sessionId for the three pages all are different.
    (each page shows in this sample the SessionId).

    This is catastropical situation.

    I think more than 30% of all internet surfers use the method to open window
    of the application by using the right mouse key and
    open windows in a new window.
    But all session data are lost.

    I hope there is any solution, because without a solution we can not use asp
    for our applications,
    because more than 30% of application-users would have failed data
    situations.

    Remark: We have made the same test with Asp 1.x /VS2003, here all works
    fine.

    Any help would be fine.
    Thank you.
    Rolf Welskes
    Rolf Welskes, Oct 8, 2006
    #1
    1. Advertising

  2. Hello Rolf,

    As for the mutiple sessionId when open pages from the same browser window
    problem, based on my experience, it is due to the ASP.NET sessionstate
    manager's lazy-loading mechanism. Actually, it is not because you open the
    link/page in a new brower windows, but due to you send a new request to the
    ASP.NET server. For ASP.NET web application, as long as you haven't stored
    any data in the certain user's sessionState, the ASP.NET runtime will not
    allocate a fixed sessionID for the current user session. You can verify
    this by refresh the browser window instead of click a link (or right click
    to open a page in new browser window. You will find that the ASP.NET will
    always return a new sessionID each time you refresh the page(send a new
    reqeust).

    You can also find the description on this in the following ASPNET
    sessionstate FAQ:

    #ASP.NET Session State FAQ
    http://www.eggheadcafe.com/articles/20021016.asp

    To prevent the ASP.NET runtime from generating random sessionID, you can
    add a test data into the SessionState so that the ID will be fixed for
    seqential requests from the same client. e.g.

    Session["data"] = "placeholder";

    Hope this helps. Please feel free to let me know if there is any other
    questions or anything else we can help.


    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================



    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Oct 9, 2006
    #2
    1. Advertising

  3. Rolf Welskes

    Rolf Welskes Guest

    Hello,
    thank you.
    If i put something in the ViewState it works fine.

    Thank you again.
    Rolf Welskes


    "Steven Cheng[MSFT]" <> schrieb im Newsbeitrag
    news:...
    > Hello Rolf,
    >
    > As for the mutiple sessionId when open pages from the same browser window
    > problem, based on my experience, it is due to the ASP.NET sessionstate
    > manager's lazy-loading mechanism. Actually, it is not because you open the
    > link/page in a new brower windows, but due to you send a new request to
    > the
    > ASP.NET server. For ASP.NET web application, as long as you haven't stored
    > any data in the certain user's sessionState, the ASP.NET runtime will not
    > allocate a fixed sessionID for the current user session. You can verify
    > this by refresh the browser window instead of click a link (or right click
    > to open a page in new browser window. You will find that the ASP.NET will
    > always return a new sessionID each time you refresh the page(send a new
    > reqeust).
    >
    > You can also find the description on this in the following ASPNET
    > sessionstate FAQ:
    >
    > #ASP.NET Session State FAQ
    > http://www.eggheadcafe.com/articles/20021016.asp
    >
    > To prevent the ASP.NET runtime from generating random sessionID, you can
    > add a test data into the SessionState so that the ID will be fixed for
    > seqential requests from the same client. e.g.
    >
    > Session["data"] = "placeholder";
    >
    > Hope this helps. Please feel free to let me know if there is any other
    > questions or anything else we can help.
    >
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    >
    > ==================================================
    >
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    >
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >
    > ==================================================
    >
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    >
    >
    >
    >
    >
    >
    Rolf Welskes, Oct 11, 2006
    #3
  4. Thanks for the followup.

    glad that you've also got it working. If there is anything else we can
    help, please feel free to post here.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Oct 12, 2006
    #4
    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. bhchng
    Replies:
    0
    Views:
    642
    bhchng
    Jan 13, 2004
  2. Ronald
    Replies:
    6
    Views:
    6,900
    Andy Mortimer [MS]
    Feb 23, 2004
  3. Mike Kline
    Replies:
    7
    Views:
    10,081
    Dakota
    Jan 13, 2009
  4. Jerad Rose

    New Browser Window = New SessionID?

    Jerad Rose, Apr 11, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    1,472
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Apr 11, 2007
  5. Spammay Blockay
    Replies:
    1
    Views:
    401
    Dietmar Meier
    Feb 4, 2005
Loading...

Share This Page