Understanding Variable Scopes

In the last section, you learned about client variables, one of the three special variable types available to you when you use an Application.cfm file. Recall that a client variable is only valid for a particular client—if a new client visits your site, a new set of client variables comes into play. Also remember that client variables use the prefix client. before the actual variable name. This is called a scope, a term you were introduced to back in Day 9, "Enhancing Your Applications with Variables and If-Then Statements."

When using Application.cfm files and thus employing ColdFusion's client and session management, the scope of your variables becomes very important. There are four variable scopes available, each ...

Get Sams Teach Yourself ColdFusion® in 21 Days 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.