What is ASP.NET State Service?

What is ASP.NET State Service?

The ASP.NET State Service offered by many reputed Windows hosting providers allows a programmer of ASP.NET to store out-of-session process data, i.e. it provides support for session states that are out of the process. ASP.NET is a server-side web application framework. It is open sourced. Programmers use it to create dynamic websites, and applications or services that run on the web. It was developed by Microsoft ASP.NET allows its programmers to write the code in any supported .NET language.
 
Each time a user visits the ASP.NET web page, the session is created. The programmer decides what user information is stored in that session. For instance, the amount of time spent by the user on a web page, any information entered on the web page, the date and time that you logged in and logged out, etc.  Each session created is assigned a unique session ID.
 
ASP.NET State Service Let us see an example. Suppose you visit a survey website. Once you enter the website, you are given a unique session ID. Assuming that you already have an account the next step is to log in with your username and password. After that, you will take a look at the surveys available and click on anyone you want to take.

Next you will answer all the questions asked in the survey. After you have completed the survey, you may choose to answer another one or log out of the website. Now, in the ASP.NET session, state all the data such as who logged in, the time of log-in, which survey was answered, etc. How many surveys were answered, the answers to the questions in the survey, the time of log out, etc. will also be stored. How and where the data is stored depends on the mode of the session state.
 
There are basically three ways in which session data can be stored, viz. in-process, SQL database and out-of-process. ASP.NET is responsible for the storage of in-process data, and the SQL database is responsible for the storage of the SQL database data. But for the out-of-process data we require the ASP.NET State Service.
 
You will see the ASP.NET State Service listed only if you have installed ASP.NET or Windows Server 2003. In case you do not want to store out-of-process data then, it is best to disable this service. However, if the service is disabled then out-of-process requests will not be processed. That said, if you are making use of out-of-process data storage then it is best that you set the ASP.NET State Service to automatic.
 
Related Articles