Chapter 7. Maintaining State

By design, the Web is a stateless environment. This means that each request from a web browser to a web server is independent of every other request. While this might make for efficient use of bandwidth, it is the bane of web developers who must be able to keep track of users as they navigate their way through an application. Without the ability to maintain state, applications have no way of knowing what information belongs to which user. To borrow from the metaphor, this means that a shopping cart can’t remember what items it contains, let alone which user is pushing the cart!

ColdFusion handles the stateless nature of the Web via a mechanism known as the Web Application Framework. The Web Application Framework enables you to build and manage virtually any type of application from a simple employee directory to amazingly complex business-to-business systems and everything in between. Specifically, the Web Application Framework was devised as a means for maintaining state, setting application constants, handling errors, and managing security.

In this chapter, we’ll discuss the state maintenance features of the Web Application Framework. Chapter 8 covers the security features, and Chapter 9 explores exception and error handling.

Setting Up the Web Application Framework

The first question you might be asking is “Why do I need an application framework in the first place”? The answer is simple: the Web Application Framework allows you to logically group ...

Get Programming ColdFusion now with O’Reilly online learning.

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