1

I have recently published my asp.net webpage and after leaving the page sit inactive and without focus for seemingly about a minute, when you attempt to press anything on the page (buttons, links, ect) the connection will time out. To get around this I must refresh the page and continue on doing whatever button/function was trying to be performed.

The session time out is set to 100 minutes currently and am at a loss as to why this is happening. My site is built using VS 2010 ult with .net v4.0(.30319) if that helps at all. Not sure what other pertinent info I can give on this as I have no clue what would be causing it.

Thanks much, Peter

3 Answers 3

1

Does your website update any files in the bin or root folder? I think the application will reload if that happens, which will effectively end all sessions.

Taken from here ...

Among the reasons it can/will restart (or technically, unload itself) is if:

  • the web.config is edited
  • the machine.config is edited
  • the global.asax is edited
  • files are changed in the bin directory of the web app, or one of the bin's subdirectories
  • a directory is created, renamed, or deleted within a web app directory
  • an ASP.NET file (aspx, asmx, etc.) is edited (and therefore recompiled) more than 20 times, a default set in the machine config as an element named numRecompilesBeforeApprestart
  • by way of settings of various attributes in the element in the machine.config, which affect the restart/shutdown of the worker process itself. On Windows 2003, when not using IIS5 isolation mode (which is not used by default), these elements are ignored and instead the settings in Application Pools in IIS manager are used
1
  • I am not aware of any files themselves being edited in any folders. Though we are hosting this with IIS7 with dynamic compilation, which I am not sure if would cause compilation over 20 times. This is our first asp web application project, as such we are quite new to publishing anything to the web. thanks again for the help
    – Hub3rt
    Commented Aug 12, 2011 at 19:02
1

Check your code for any session.abandon, or creating a new session, etc. Make sure it's happening at the right time, not on each postback, etc.

2
  • Hey thanks for the response. Though I do not have anything with session.abandon anywhere (that I can find/that I wrote at least). There is a lot of session data being pushed in and out, but not anything with a new session.
    – Hub3rt
    Commented Aug 12, 2011 at 18:58
  • Sorry it didn't help. Anyway, I'd suspect that your session isn't timing-out -- it sounds like either what Antony said in his answer, or else your session is getting re-created when you do a postback. One tool you can use is the On_Session_Start in global.asax. (Make sure to switch your session state to inProc in your web.config first).
    – Chains
    Commented Aug 12, 2011 at 19:51
1

Check if you are using Load Balancer and if you are using load balancer see how you are managing load by using sticky cookies or else.

Preferably we should be using sticky cookies on load balancer it will make sure your request is sent to same server for defined time and your cookies won't get lost and best solution is use session database in case of Web farm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.