Understanding Session State Management in ASP.NET
ASP.NET Session State Management allows developers to automatically identify and categorizes all the requests coming from a single client browser into a logical application session on the server. A web application such as shopping carts needs a strategy that displays and stores all the client requests according to the permission provided to the client. ASP.NET Session State Management has built-in functionality that stores the data according to the sessions on the server. This data is then used for across multiple browser requests.
ASP.NET Session State Management also has the facility that automatically invokes the appropriate session events such as Session OnStart and Session OnEnd. Moreover, ASP.NET Session State Management automatically erases a particular session data if the client browser does not revisit that application within a specified time. This is in contrast to HTTP, which is considered to be a stateless protocol. A stateless protocol does not display and store cross-request state information.
In ASP.NET Session State Management, you can restart IIS or worker-process without any apprehension of losing session data. You can also work with the browsers that do not support HTTP cookies. Moreover, you can use an ASP.NET Session State Management in both multi-computer and multi-processor architectures that enables you to increase the scalability of web applications. Apart from all the advantages relating to ASP.NET Session State Management, it too has one major disadvantage. A session state in one ASP.NET web application does not remain consistent on all web applications.
ASP.NET provides three session state modes such as in-process, State Server, and SQL Server. The basic configuration process is the same for whichever mode you choose. You can identify and track any active ASP.NET session by using 120-bit SessionID string. This string contains only ASCII characters that are recognized in a URL.