Loss of sessions

Discussion in 'ASP.NET / ASP.NET Core' started by Major_Disorder, Nov 24, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello all.

    My users too are having a (huge) problem with a seesion ending after around 30min or so. And then they can not access the database for some period of time, that is, after they are booted out of an active session, they can not access pages that require info from the MS SQL Server for however long.

    To access the 'dynamic' part of my website requires a login that I handle myself, I keep their password, I check their password. I saw friend "bruce" post a fix that is:

    "<forms loginUrl="default.aspx" protection="None" timeout="15"/>"

    Does this apply to me? I have no 'default.aspx', but do have a default page named something else, however this default page is independent of my 'login' (which again, I verify against my DB).

    Does the above web.config apply to my site? If so, where would I put it in my config file as shown:

    <configuration>
    <system.web>
    <compilation defaultLanguage="c#" debug="true" />
    <customErrors mode="Off" />
    <authentication mode="Windows" />
    <authorization> <allow users="*" /> </authorization>
    <sessionState
    mode="InProc"
    stateConnectionString="tcpip=127.0.0.1:42424"
    sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
    cookieless="false"
    timeout="20" />
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    </system.web>
    </configuration>

    If it does not apply but is in fact a fix to this killer problem of users loseing active sessions, then I reckon I must use an "authentication mode" that would allow the fix.

    Arg, I'm confused. I thought a session timeout period related to inactivity reguardless of authentication mode, not to 'absolute time'.

    Any help?

    Thanks.

    www.abovethefiels.com
    and for the part that uses the MSSQL DB,
    www.abovethefields.com/gaming/login.aspx

    http://www.abovethefields.com
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Are you sure that's a session reset?

    It should not have anything to do with MS SQL connection.


    quote:Originally posted by Burkhalter

    Hello all.

    My users too are having a (huge) problem with a seesion ending after around 30min or so. And then they can not access the database for some period of time, that is, after they are booted out of an active session, they can not access pages that require info from the MS SQL Server for however long.

    To access the 'dynamic' part of my website requires a login that I handle myself, I keep their password, I check their password. I saw friend "bruce" post a fix that is:

    "<forms loginUrl="default.aspx" protection="None" timeout="15"/>"

    Does this apply to me? I have no 'default.aspx', but do have a default page named something else, however this default page is independent of my 'login' (which again, I verify against my DB).

    Does the above web.config apply to my site? If so, where would I put it in my config file as shown:

    <configuration>
    <system.web>
    <compilation defaultLanguage="c#" debug="true" />
    <customErrors mode="Off" />
    <authentication mode="Windows" />
    <authorization> <allow users="*" /> </authorization>
    <sessionState
    mode="InProc"
    stateConnectionString="tcpip=127.0.0.1:42424"
    sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
    cookieless="false"
    timeout="20" />
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    </system.web>
    </configuration>

    If it does not apply but is in fact a fix to this killer problem of users loseing active sessions, then I reckon I must use an "authentication mode" that would allow the fix.

    Arg, I'm confused. I thought a session timeout period related to inactivity reguardless of authentication mode, not to 'absolute time'.

    Any help?

    Thanks.

    www.abovethefiels.com
    and for the part that uses the MSSQL DB,
    www.abovethefields.com/gaming/login.aspx

    http://www.abovethefields.com
    </blockquote id="quote"></font id="quote">
     
  3. My problem remains, every 20 to 40 minutes I *know for a fact* that *as I described previously* the aspnet_wp.exe worker process is restarting on the server(s) that my site is hosted (OR) the Application Domain is being programatically reset. This is *regardless* of the fix that has been mentioned in this thread several times which I *did* try.
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    Another reason why the process is recycle is because of high memory usage. Any worker process exceeding 100MB will be recycled.


    quote:Originally posted by diltonm

    My problem remains, every 20 to 40 minutes I *know for a fact* that *as I described previously* the aspnet_wp.exe worker process is restarting on the server(s) that my site is hosted (OR) the Application Domain is being programatically reset. This is *regardless* of the fix that has been mentioned in this thread several times which I *did* try.

    </blockquote id="quote"></font id="quote">
     
  5. Thanks for fast reply Bruce to my post on the 20th.

    Right, I understand the problem has nothing to dow with the database. Anyway, The problem of the frequent resets seems to have been cured by changing my sessionState timeout from the VS .NET default of '20' to '480'.:

    <sessionState mode="InProc" ..... timeout="480" />

    One Question: I assumed the sessionState timeout related to Inactivity, not an Absolute seesion time. It appears this changed worked, and hence my assumption sessionState timeout is an Abosolute time period.... is this true?

    If true, is there an Inactivity Timeout in web.config?

    My basic question of the first post was about your stated fix from an earlier post, where you said add:

    "<forms loginUrl="default.aspx" protection="None" timeout="15"/>"

    Is this directly under 'system.web'?
    My authentication mode="Windows", whould the above even apply?

    Thanks.

    http://www.abovethefields.com

    though the "cool" .Net part begins at

    http://www.abovethefields.com/gaming/login.aspx

    http://www.abovethefields.com
     
  6. I've not found a solution to the ASP.NET worker process is restarting every 20 to 40 minutes problem. This means my entire site is restarting and any sites on the same server. The effect can also be noticed by waiting about 40 minutes then hitting my home page and there is a noticible delay while IIS reloads the ASP.NET worker process.

    This is detrimental to the performance and consitency of my site. The standard ASP.NET installation does not do this. There has to be some custom setting most likely in machine.config and probably not overridable in web.config that governs (or causes) this bahavior.
     
  7. Would like to add my users sessions abuptly end after some amount of time (sometimes an hour, sometimes 30 minutes).

    A fix was posted earlier than assumes authentication mode is forms. Does this mean if authentication mode is Windows there is no fix?

    I understand that if the web app usess 100MB or so of memory it will be kicked out, Idon't think this is the problem.





    http://www.abovethefields.com
     
  8. Today I went through the code and called 'Dispose' for all SQL commands and connections, and in this half day of testing the sudden session end has stopped.

    And so far the Discount ASP web site is a fast as ever, no session boots, excelent.

    http://www.abovethefields.com
     
  9. That's good to hear. I've not been actively using any SQL on my site here. My problem remains. This is the only .NET ISP I use. On many machines I've had ASP.NET installed on an not on the Internet, I've not had such a problem as this.
     
  10. Would it be possible to create some "Keep alive" code and put it in the session end event so that when the session ends it automatically gets restored?

    Let me know if this works because I have the same problem.
     
  11. I think the problem extends beyond sessions. I've created a C# static timer that regularly updates a text file. It writes "starting" when my site's DLL gets loaded. Since the timer is static, only two things can stop it if I don't manually; 1) my site's DLL gets unloaded or 2) the entire ASP.NET worker process is blown away by 'something'. If the latter is the case, and I think it may be because I can think of noting ain my expereince that would cause just my site's DLL to be unloaded excepting possibly server load but that would ahve to be an extreme case and would also still affect other sites on the same server; so either way I think all sites on that server are affected.

    Also I have a DASP scheduled job that hits a Web Service compiled into my site's DLL and there is always a gap in time between the last time entry recorded in the log and when "starting" is written to the log.
     
  12. I've had a similar problem when downloading large files using streams. A download would be going fine and then I would get a session reset. The correction for me was adding a executionTimeout entry into my web.config file.

    <httpRuntime executionTimeout="1800" />

    This extended the amount of time that was allowed for a request to execute. Perhaps if your problems are being caused by a random SQL statement running long and timing out this could help.



    Phil Curnan
    www.wildmousesoftware.com
    Warehouse Management System Implementation Tools Targeted to the SMB Market.
     
  13. Thanks Phil, those are good points. Another property of httpruntime is:

    "maxRequestLength="[KBytes]" - KBytes size of maximum request length to accept"

    which affects the file size.

    Thing is, I run no SQL and have no long running jobs or connections.
     
  14. The problem seems to have cleared up!! I've checked back over my logs for several days since the 20th at least, and haven't seen the regular stopping. It's been running very regular.

    I don't know if the DASP staff changed something? If you did then thanks very much!!
     
  15. good to hear diltonm.

    Again, I do use a SQL database, and since May 31st (after I made some code change, so the problem was mine and not DsicountASP in the first place) my DiscountASP site has been excelent.

    http://www.abovethefields.com
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page