Home > DeveloperSection > Interviews > What are the Session State Modes? Define each Session State mode supported by ASP.NET.

Posted on    October-25-2010 12:00 AM

 ASP.Net ASP.Net 
 1 Answer(s)
  1272  View(s)
Rate this:

Pushpendra Singh

Total Post:241

Posted on    October-26-2010 12:00 AM

ASP.NET supports three Session State modes.

  • InProc
  • State Server
  • SQL Server

InProc Mode
This mode stores the session data in the ASP.NET worker process.
This is the fastest among all of the storage modes.
This mode effects performance if the amount of data to be stored is large.
If ASP.NET worker process recycles or application domain restarts, the session state will be lost.

State Server mode
In this mode, the session state is serialized and stored in memory in a separate process.
State Server can be maintained on a different system.
State Server mode involves overhead since it requires serialization and de-serialization of objects.
State Server mode is slower than InProc mode as this stores data in an external process.

SQL Server Mode
In this storage mode, the Session data is serialized and stored in a database table in the SQL Server database.
This is reliable and secures storage of a session state.
This mode can be used in the web farms.
It involves overhead in serialization and de-serialization of the objects.
SQL Server is more secure than the InProc or the State server mode. 

Don't want to miss updates? Please click the below button!

Follow MindStick