Session is a State Management Technique. A Session can store the value on the Server. It can support any type of object to be stored along with our own custom objects. A session is one of the best techniques for State Management because it stores the data as client-based, in other words the data is stored for every user separately and the data is secured also because it is on the server.
We can set the session on one of the following 2 types of configuration files:
- Machine Configuration file: Machine Configuration is applied for all application.
- Application Configuration file: It's applied for only application by application basis.
Session Mode
In ASP.NET there are 4 types of Session Mode.
Off
We can disable the session mode for the entire application using the off mode.
According to performance and durability the difference between InProc,State Server and SQL Server is:
Session mode |
Performance Durability |
InProc |
More(1 processor and 1 server) less. |
State Server |
Medium(n processor and 1 server) Medium |
SQL Server |
Less More |