Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of all i must say that these "guidelines" are generic and not iis-7 exclusive. In web.config under <code>&lt;system.web&gt;</code> you either have <code>&lt;sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" timeout="130" cookieless="false"/&gt;</code> (which requires the ASP.NET Session State Server service running on localhost) or <code>&lt;sessionState mode="InProc" timeout="130" cookieless="false"/&gt;</code>. The main difference is that in InProc that session state data are placed in the application process itself. In the other setting a different service is doing the storage, and you application just polls it to get the required data. Having used both (as well as sql-server session state mode) the InProc is the least reliable but the fastest. The Sql-server is the most reliable and the slowest and the StateServer mode is somewhere in the middle being unreliable only in the case of a power/system failure. Having said that, i must say that for site with a low request count the performance penalty is negligible.</p> <p>Now, my experience has shown that InProc is quite unpredictable on its stability; i used to have the same problem with you. I was able to extend the stability of the application by tweaking the settings of the application pool, i removed the problem altogether by switching to SessionState (which also allows to bring down the application and not lose session state data).</p> <p>The reasons that you may suffer from application/session stability:</p> <ol> <li><p>IIS and application pooling. Each virtul directory of a website is assigned to an application pool (by default to "DefaultAppPool") which has a series of settings amongst which you define the interval that the process is "recycled" - and as such preserve system resources. If you don't change the settings the application may trigger one of the criteria for the process recycler, which means that your application is busted</p></li> <li><p>Antivirus. In a ASP.NET application if the web.config (and any child .config files the application depends on) file is touched the application is restarted. Now there are cases where an antivirus program may touch the web.config file (say once a day?) and as such the application is restarted and session data is lost.</p></li> <li><p>Bad configuration Specifically for Forms Authentication the time-related settings and behavior always where dependent on the web-session with the auth-session being under the web-session. </p></li> </ol> <p>What i don't know is if the Forms Authentication module depends only on Session domain or if it also places data in the application domain as well. If the second is the case then you may have to disable all recycling settings in the Application Pool as well as checking again configuration/antivirus and who stores the session data.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload