
DevelopingWebApplicationswithColdFusionDRAFT 5/9/01 Path/Filename/Author
ix
Client, Session, Application, and Server scopevariables . . . . . . . . .. . . . . 214
Custom error handling .. . . . . . .. . .. . . . . . .. . . . . .. . . . . . .. . .. . . . . . .. . 215
Web server security integration . . . .. . . . . . .. . .. . . . . . .. . . . . .. . . . . . .. . 215
Mapping an ApplicationFramework . . . . . . .. . . . . . .. . . . . . .. . . . . .. . . .. . . . . 216
Processing Application.cfm and OnRequestEnd.cfm . . . . . . . .. . . .. . . . . 216
Defining the directorystructure . . . . . . . . . . . . .. . . . . . .. . .. . . . . . .. . . . . 217
Creating the Application.cfm File . . . . . . . . . . . . . .. . .. . . . . . .. . . . . .. . . . . . .. . 219
Namingthe application . . . . . . . . . .. . . . . . .. . . . . .. . . .. . . . . .. . . . . . .. . 219
Settingapplication default variables and constants . . . . . .. . . . . . .. . . . . 219
Managing the Client State. . . . . . . . . . .. . . . . .. . . .. . . . . .. . . . . . .. . . . . . .. . . . . 221
AboutClient and Sessionvariables .. . . . . . .. . . . . .. . . . . . .. . . . . . .. . .. . 221
About client cookies . . . .. . . . . . .. . .. . . . . . .. . . . . .. . . . . . .. . . . . . .. . .. . 222
Managing client state ina clustered environment . . . . . . . . . .. . . . . . .. . 222
Managing client state without cookies . . . .. . . . . .. . . . . . .. . . . . . .. . . . . 222
Configuring and Using Client Variables. . . . . . . . . . . .. . .. . . . . . .. . . . . . .. . . . . 223
Settingup Clientvariable options . . . . . . . . .. . .. . . . . . .. . . . . .. . . . . . .. . 223
Using Client variables . . . . . . . . .. . . . . .. . . .. . . . . .. . . . . . .. . . . . . .. . . . . 224
Using Session Variables . . . . . . . . .. . . . . . .. . . . . . .. . . . . .. . . .. . . . . .. . . . . . .. . 228
EnablingSession variables . . . . .. . . . . .. . . . . . .. . . . . . .. . .. . . . . . .. . . . . 228
What is a session? . . . . . . . . .. . . .. . . . . .. . . . . . .. . . . . . .. . .. . . . . . .. . . . . 228
Storingsession data inSession variables . . . . .. . . . . . .. . . . . .. . . . . . .. . 229
Standard Session variables . . . . . . . .. . . . . . .. . . . . .. . . .. . . . . .. . . . . . .. . 229
Getting a list of Session variables . . . . .. . . . . . .. . .. . . . . . .. . . . . . .. . . . . 230
Using Application Variables . . . . .. . . . . . .. . . . . . .. . . . . .. . . . . . .. . .. . . . . . .. . 230
Storingapplication data in Application variables . . . . . . . . . . .. . . .. . . . . 230
Applicationvariable timeouts . .. . . . . .. . . . . . .. . . . . . .. . .. . . . . . .. . . . . 231
Tips for using Application variables . . . . . . .. . . . . .. . . . . . .. . . . . . .. . . . . 231
Getting a list of Application variables . . . . .. . . . . .. . . . . . .. . . . . . .. . .. . 231
Using Server Variables . . . . . . .. . . . . . .. . . . . .. . . . . . .. . .. . . . . . .. . . . . . .. . . . . 232
Locking Code withcflock. . . . . . . .. . . . . . .. . . . . . .. . .. . . . . . .. . . . . .. . . . . . .. . 233
Using cflock .. . . . . . .. . .. . . . . . .. . . . . .. . . . . . .. . . . . . .. . .. . . . . . .. . . . . 233
How cflock works . . . . . .. . . . . . .. . . . . .. . . . . . .. . .. . . . . . .. . . . . . .. . . . . 233
Using administrative lock management . . . . . .. . .. . . . . . .. . . . . . .. . . . . 236
Nesting locks and avoiding deadlocks . . . . . . . .. . .. . . . . . .. . . . . . .. . . . . 237
Examples of cflock. . . .. . . . . . .. . . . . . .. . .. . . . . . .. . . . . .. . . . . . .. . . . . . .. . .. . 238
Chapter 13 Extending ColdFusion Pages with CFML
Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
About CFScript. . . . . . .. . . . . . .. . . . . . .. . .. . . . . . .. . . . . .. . . . . . .. . . . . . .. . .. . 244
CFScriptexample . . . . . .. . . . . . .. . .. . . . . . .. . . . . .. . . . . . .. . . . . . .. . .. . 244
Supported statements . . . . .. . . . . . .. . . . . . .. . . . . .. . . . . . .. . .. . . . . . .. . 244
The CFScript Language . . . . . . . . .. . . . . . .. . . . . . .. . . . . .. . . .. . . . . .. . . . . . .. . 245
Comments . . . . .. . . . . . .. . . . . . .. . . . . .. . . .. . . . . .. . . . . . .. . . . . . .. . . . . 245