Yes ... yet another question about Session State!! - Long

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Yes ... yet another question about Session State!! - Long

    Hi all

    As my posting title suggests I'm having problems using InProc Session
    state in my ASP .NET app.

    I wrote a site for a friend which uses ADO .NET to keep track of a
    simple customer/purchases database. A user creates an account and a
    database entry is added to a customer table. Once a user successfully
    logs in with a valid Username/Password I store away the UserID (which
    is the primary key of the Customers table) in the Session object, and
    use this across the app to reference data for display.

    Everything worked perfectly on my server at home : XP Pro, IIS 5.1
    however as soon as i uploaded everything to my host (oneandone.co.uk)
    I began to see intermittent Session state fall out. I was testing for
    Session["UserID"] = null and moving user to a default login page (set
    in web.config) if this was true, the idea being to stop people
    navigating directly to a page without first logging in. This began to
    happen 'randomly' whilst a user was validly logged in. This has
    nothing to do with the timing out of Session. This is set to 100 mins
    in my config file and session sometimes falls out on the first page
    move after valid login.

    The only consistent clue that I can report is that the Nulling of my
    Session object always seems to happen when a refresh of a page is NOT
    instant but when there is some server delay. You know ... you hit F5
    and the server is slow to respond. When this happens I always know
    that Session will be null when page comes back. Maybe this is the key.
    But I don't know the reason.

    Because the site was effectively broken with this behaviour, and the
    system was 'live' I quickly had to tear everything down and recode the
    solution using Query Strings in the urls. Very combersome, but the
    site now works.

    Now the dust has settled I want to find out why the Session state was
    'broken'.
    I believe oneandone use Windows Server 2003 with IIS 6.0. They have
    only very recently started to offer ASP .NET and I suspect they may
    have set something up incorrectly (of course it could be something
    i've done wrong LOL)

    I found the following Knowledge Base articles that point to possible
    answers :
    [url]http://support.microsoft.com/default.aspx?scid=kb;EN-US;316148[/url]
    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;324772[/url]

    The first of these provides some sample code to test for Session State
    fallout and I have uploaded this to my host and indeed I get the same
    intermittent 'fallout' as I did with my own code.

    The second of these suggests that the problem could be caused by,
    "Virus scanning software touched some .config files" and goes on to
    say, "This is why the session state is lost when Aspnet_wp.exe (or
    W3wp.exe, for applications that run on Microsoft Internet Information
    Services [IIS] 6.0) or the AppDomain restarts."

    I cannot believe Anti-Virus software on my host can be causing the
    problem, as if this was the case they (and this newsgroup, I'm sure)
    would have been inundated with queries, however, I need to eliminate
    this cause from the equation. I shall mail their support team and ask
    them specifically about the Anti-Virus issue, but I was wondering if
    there was something I could do in code (C# preferably) that could test
    explicitly for W3wp.exe restarting.

    Thinking about it, maybe the server sluggishness just before session
    goes null, that I reported earlier, was this .exe restarting!! ??

    Apologies for the length of the post and thank you to those of you who
    have stuck with it :) I look forward to your suggestions for a way
    forward, or any comments on similar experiences.

    Thank you for listening.

    Kind Regards,

    Martin
    Martin Guest

  2. Similar Questions and Discussions

    1. Question about a long session timeout (somewhat long)
      I've been told by my developers to increase the asp.net session timeout to 72 hours. Being a server guy, it concerns me because of the obvious...
    2. Session state IIS (Machine Key | Load Balanced Session)
      This is a classic ASP group. Try microsoft.public.dotnet.framework.aspnet "Fred" <me@me.com> wrote in message...
    3. Urgent question regarding Session state in webservice
      hi I wanted to know whether we can store something in Session objects in webservice.My windows application calls the webservice and i want the...
    4. Session state question
      Inactivity, meaning no new request from the client. Note that this means that if the user sits at his browser for one minute, and then makes a new...
    5. Newbie question: session state:
      I am fairly new to ASP.NET so please forgive errors in terminology. I am using the CrystalReportsViewer control to display report data over the...
  3. #2

    Default Re: Yes ... yet another question about Session State!! - Long

    The asp.net process may recycle itself and cause you to lose session if the
    process takes a certain % of system memory as defined in the
    machine.confiig. There are plenty of articles on how to monitor this.

    I'm not sure about w2k3, but I'm sure the asp appliation start event will
    run everytime the w3wp.exe restarts, so you could simply log the time to the
    file everytime this happens.

    "Martin" <martin.stickley@btinternet.com> wrote in message
    news:5d4272e3.0307221410.7daa8722@posting.google.c om...
    > Hi all
    >
    > As my posting title suggests I'm having problems using InProc Session
    > state in my ASP .NET app.
    >
    > I wrote a site for a friend which uses ADO .NET to keep track of a
    > simple customer/purchases database. A user creates an account and a
    > database entry is added to a customer table. Once a user successfully
    > logs in with a valid Username/Password I store away the UserID (which
    > is the primary key of the Customers table) in the Session object, and
    > use this across the app to reference data for display.
    >
    > Everything worked perfectly on my server at home : XP Pro, IIS 5.1
    > however as soon as i uploaded everything to my host (oneandone.co.uk)
    > I began to see intermittent Session state fall out. I was testing for
    > Session["UserID"] = null and moving user to a default login page (set
    > in web.config) if this was true, the idea being to stop people
    > navigating directly to a page without first logging in. This began to
    > happen 'randomly' whilst a user was validly logged in. This has
    > nothing to do with the timing out of Session. This is set to 100 mins
    > in my config file and session sometimes falls out on the first page
    > move after valid login.
    >
    > The only consistent clue that I can report is that the Nulling of my
    > Session object always seems to happen when a refresh of a page is NOT
    > instant but when there is some server delay. You know ... you hit F5
    > and the server is slow to respond. When this happens I always know
    > that Session will be null when page comes back. Maybe this is the key.
    > But I don't know the reason.
    >
    > Because the site was effectively broken with this behaviour, and the
    > system was 'live' I quickly had to tear everything down and recode the
    > solution using Query Strings in the urls. Very combersome, but the
    > site now works.
    >
    > Now the dust has settled I want to find out why the Session state was
    > 'broken'.
    > I believe oneandone use Windows Server 2003 with IIS 6.0. They have
    > only very recently started to offer ASP .NET and I suspect they may
    > have set something up incorrectly (of course it could be something
    > i've done wrong LOL)
    >
    > I found the following Knowledge Base articles that point to possible
    > answers :
    > [url]http://support.microsoft.com/default.aspx?scid=kb;EN-US;316148[/url]
    > [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;324772[/url]
    >
    > The first of these provides some sample code to test for Session State
    > fallout and I have uploaded this to my host and indeed I get the same
    > intermittent 'fallout' as I did with my own code.
    >
    > The second of these suggests that the problem could be caused by,
    > "Virus scanning software touched some .config files" and goes on to
    > say, "This is why the session state is lost when Aspnet_wp.exe (or
    > W3wp.exe, for applications that run on Microsoft Internet Information
    > Services [IIS] 6.0) or the AppDomain restarts."
    >
    > I cannot believe Anti-Virus software on my host can be causing the
    > problem, as if this was the case they (and this newsgroup, I'm sure)
    > would have been inundated with queries, however, I need to eliminate
    > this cause from the equation. I shall mail their support team and ask
    > them specifically about the Anti-Virus issue, but I was wondering if
    > there was something I could do in code (C# preferably) that could test
    > explicitly for W3wp.exe restarting.
    >
    > Thinking about it, maybe the server sluggishness just before session
    > goes null, that I reported earlier, was this .exe restarting!! ??
    >
    > Apologies for the length of the post and thank you to those of you who
    > have stuck with it :) I look forward to your suggestions for a way
    > forward, or any comments on similar experiences.
    >
    > Thank you for listening.
    >
    > Kind Regards,
    >
    > Martin

    PJ Guest

  4. #3

    Default Re: Yes ... yet another question about Session State!! - Long

    Hi Martin,

    Didn't you say at the beginning of your message that this host has "only
    very recently" started to support ASP.Net? If so, why would anyone be
    "inundated with queries" about their use of virus protection software? You
    found a Knowledge Base article. That means that this problem has occurred
    and been reported enough times to Microsoft to write a KB article about it.
    Virus protection software has been responsible for many a problem. It's a
    simple matter of a phone call or email to confirm it.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of little things.

    "Martin" <martin.stickley@btinternet.com> wrote in message
    news:5d4272e3.0307221410.7daa8722@posting.google.c om...
    > Hi all
    >
    > As my posting title suggests I'm having problems using InProc Session
    > state in my ASP .NET app.
    >
    > I wrote a site for a friend which uses ADO .NET to keep track of a
    > simple customer/purchases database. A user creates an account and a
    > database entry is added to a customer table. Once a user successfully
    > logs in with a valid Username/Password I store away the UserID (which
    > is the primary key of the Customers table) in the Session object, and
    > use this across the app to reference data for display.
    >
    > Everything worked perfectly on my server at home : XP Pro, IIS 5.1
    > however as soon as i uploaded everything to my host (oneandone.co.uk)
    > I began to see intermittent Session state fall out. I was testing for
    > Session["UserID"] = null and moving user to a default login page (set
    > in web.config) if this was true, the idea being to stop people
    > navigating directly to a page without first logging in. This began to
    > happen 'randomly' whilst a user was validly logged in. This has
    > nothing to do with the timing out of Session. This is set to 100 mins
    > in my config file and session sometimes falls out on the first page
    > move after valid login.
    >
    > The only consistent clue that I can report is that the Nulling of my
    > Session object always seems to happen when a refresh of a page is NOT
    > instant but when there is some server delay. You know ... you hit F5
    > and the server is slow to respond. When this happens I always know
    > that Session will be null when page comes back. Maybe this is the key.
    > But I don't know the reason.
    >
    > Because the site was effectively broken with this behaviour, and the
    > system was 'live' I quickly had to tear everything down and recode the
    > solution using Query Strings in the urls. Very combersome, but the
    > site now works.
    >
    > Now the dust has settled I want to find out why the Session state was
    > 'broken'.
    > I believe oneandone use Windows Server 2003 with IIS 6.0. They have
    > only very recently started to offer ASP .NET and I suspect they may
    > have set something up incorrectly (of course it could be something
    > i've done wrong LOL)
    >
    > I found the following Knowledge Base articles that point to possible
    > answers :
    > [url]http://support.microsoft.com/default.aspx?scid=kb;EN-US;316148[/url]
    > [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;324772[/url]
    >
    > The first of these provides some sample code to test for Session State
    > fallout and I have uploaded this to my host and indeed I get the same
    > intermittent 'fallout' as I did with my own code.
    >
    > The second of these suggests that the problem could be caused by,
    > "Virus scanning software touched some .config files" and goes on to
    > say, "This is why the session state is lost when Aspnet_wp.exe (or
    > W3wp.exe, for applications that run on Microsoft Internet Information
    > Services [IIS] 6.0) or the AppDomain restarts."
    >
    > I cannot believe Anti-Virus software on my host can be causing the
    > problem, as if this was the case they (and this newsgroup, I'm sure)
    > would have been inundated with queries, however, I need to eliminate
    > this cause from the equation. I shall mail their support team and ask
    > them specifically about the Anti-Virus issue, but I was wondering if
    > there was something I could do in code (C# preferably) that could test
    > explicitly for W3wp.exe restarting.
    >
    > Thinking about it, maybe the server sluggishness just before session
    > goes null, that I reported earlier, was this .exe restarting!! ??
    >
    > Apologies for the length of the post and thank you to those of you who
    > have stuck with it :) I look forward to your suggestions for a way
    > forward, or any comments on similar experiences.
    >
    > Thank you for listening.
    >
    > Kind Regards,
    >
    > Martin

    Kevin Spencer Guest

  5. #4

    Default Re: Yes ... yet another question about Session State!! - Long

    Kevin

    Point taken. I will definately give the help line a ring. That is the
    next time I feel like waiting in a queue for half an hour ;)

    Martin

    "Kevin Spencer" <kevin@takempis.com> wrote in message news:<uW910IRUDHA.2180@TK2MSFTNGP12.phx.gbl>...
    > Hi Martin,
    >
    > Didn't you say at the beginning of your message that this host has "only
    > very recently" started to support ASP.Net? If so, why would anyone be
    > "inundated with queries" about their use of virus protection software? You
    > found a Knowledge Base article. That means that this problem has occurred
    > and been reported enough times to Microsoft to write a KB article about it.
    > Virus protection software has been responsible for many a problem. It's a
    > simple matter of a phone call or email to confirm it.
    >
    Martin Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139