State Management in ASP.NET Applications

State management is related to caching—whereas caching keeps global state for multiple clients, session state keeps state for a single client. Web applications are stateless; therefore, they don’t inherently track user information between requests. Each request is viewed as a distinct request entirely unrelated to previous requests.

ASP.NET provides several levels at which state can be managed. These are cookies, ViewState, Session, and Application.

The following sections cover each of these different state management mechanisms.

Managing State with Cookies

Cookies are basically text that the Web server can place in the client’s browser. They are transferred via HTTP headers. As the user hits various pages ...

Get Delphi for .NET Developer’s Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.