Not Using ASP.NET Session State? Then Turn It Off
Not Using ASP.NET Session State? Then Turn It Off
Submitted by Corey Goldberg on Thu, 22/02/2007 - 16:37.I am developing some small ASP.NET 2.0 web applications. They are stateless and I am not doing anything with Session State. However, I noticed that ASP.NET enables Session State by default (In-process mode is the default setting). Therefore, if you have a truly stateless site or application, session state does nothing more than slow down performance.
In-process session state is still relatively fast, as the memory used to handle session is allocated by the same process on the local machine (no cross-process calls or data marshaling). But this is needless overhead if you are not using your Session State.
So... to turn it off for the whole application, add the following line to your web.config, inside the system.web section:
