Browse DevX
Sign up for e-mail newsletters from DevX


Client- and Server-side Solutions to Managing State in ASP.NET : Page 7

Whether you are building a traditional Windows application or a Web-based application, state is what an application knows about the user, their current interaction with the application, and other pieces of global information. Get a full assessment of the best techniques for managing state.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Session State Modes
By default, all session state information is managed in the same Windows process that the Web server and ASP.NET run in. This is known as running in process. A clear advantage of running in process is performance since all the data is immediately available to the Web server. However, storing the session state in process can have some disadvantages.

  • A Web server crash will lose all the current session data.
  • You lose session data if the application is restarted for any reason.
  • In process session state cannot be shared across multiple Web servers so this limits the scalability of your site. Obviously this is a problem if you plan to scale up to a Web farm.
Fortunately, ASP.NET provides the capability to store session state variables out-of-process. This means that the session state variables are NOT managed within the same Windows process that ASP.NET runs in. The advantage to managing session state out-of-process is that users can seamlessly move from Web server to Web server (though they don't know it) and still maintain their state. Table 2 lists the session state modes available in ASP.NET.

Table 2: The session state modes available in ASP.NET.




Session state data is stored in the same process as the ASP.NET worker process (default).


Session state is not tracked.


Session state data is stored using an out-of-process server.


Session state data is stored using an out-of-process SQL Server.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date