InProc Session State Mode in ASP.Net

ASP.NET session state supports different storage options for session data: InProc mode, StateServer mode, SQLServer mode, Custom mode and Off mode. In this article I will give you an step-by-step guide on how to use InProc Session State Mode in your ASP applications.

What is InProc Session State Mode and Why is useful for my ASP hosting account?

In-proccess mode stores session state in memory on the Web server and is the default session state mode. In-process mode stores session state values and variables in memory on the local Web server. It is the only mode that supports the Session_OnEnd event.  InProc Session State is much much faster, has less requirements (serialization), and it is better than SQL Sessions, which generate significant server overhead.

General process for InProc Session State

You can set the InProc Session State Mode and session timeout in the Web.Config file of you application like this:

Code:

<configuration>
<system.web>
<sessionState mode="InProc" timeout="25"></sessionState>
</system.web>
</configuration>

Screenshot visual studio webcofing arvixe asp websitepanel

InProc Session State Mode is easy to implement and it stores the session data on the server very fast, but when the application domain or worker process restart, the session data will be lost and if you have more session data, means more memory used in the web server and that could affect the performance of your web application.

In conclusion, InProc Session State mode is a process of fast storage, but you should use in small applications, because the session data will be lost if the server is restart or if the application domain is recycled.

This concludes InProc Session State Mode in ASP.Net.

Looking for quality Windows Hosting? Look no further than Arvixe Web Hosting!

Happy Hosting!

Rodolfo Hernandez

Tags: , , , , , , , , , , , , , , , , , | Posted under ASP .NET 4.0, WebsitePanel Tutorials | RSS 2.0

Author Spotlight

Rodolfo Hernandez

I like photography and reading books. Currently working for Arvixe as Elgg Community Liaison. Elgg Security Expert Web Security Expert CEO of UDP SW Social Web

Leave a Reply

Your email address will not be published. Required fields are marked *