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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.