
272
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Chapter 13Application Class
13
The HttpApplicationState
Class
Developers who are new to web-based development encounter several challenges.
Among the most serious is the realization that rather than a single monolithic
application, web-based applications are just a series of pages. A web server is like
an unusually inattentive waiter. Imagine sitting down for dinner and placing your
order for drinks. When you next see the waiter, he asks you again what you
would like to drink, as if he has never seen you before. Each request to the web
browser is seen as a completely new request, totally unrelated to any previous
request.
Several problems with the way web-based applications are structured need to be
resolved:
• Session data (data specific to a single user across all pages) needs to be avail-
able. While it is always a good idea to minimize session state, it is generally
not possible to completely eliminate session state.
• Global data (data required across all pages and to all users) needs to be
exposed. Traditional rich-client applications use global variables to store
needed data application-wide. Classes instantiated on one page are not avail-
able to other pages, so creating global classes is not a solution.
Session data in ASP.NET can be managed in the
HttpSessionState class, which ...