Variables in CFML; Overview of CFML Scopes

What follows is a quick reference to important information about each of the scopes defined in CFML. These scopes will be fully explained in the following pages.

Scopes Accessible as Structures

In CFMX all named scopes are available as structures. In CF 4.5 and 5.0 all named scopes with the exception of the Variable, Caller, Client, and Server scopes are available as structures.

This means that all of the CFML structure functions may be used to manipulate these scopes. In CF 5.0 and above the <CFDUMP> may be used to output the entire contents of any of these scopes.

Quick Reference Chart

Unless otherwise noted al of the following scopes are available in ColdFusion versions 4 and above.

Scope
Prefix
Locking
Required?
Can accept
Complex Data Types?
Internet
Standard?
Prefix Required
to Access?
Transient Variable Scopes
  Variables     
  CGI     
  URL     
  Form     
  Request*   
Persistent Variable Scopes
  Cookie     
  Client       
  Server  
  Application  
  Session  
Extension Scopes (Custom Tags)
  Attributes   
  Caller   
  ThisTag   
Extension Scopes (Components/Functions)
  Arguments**     
  This***   
  Function Local**     

* Introduced in CF 4.5
** Introduced in CF 5.0
*** Introduced in CFMX

Other Scopes

ColdFusion provides many other special-purpose scopes. Most of these are specific to certain CFML tags and represent information concerning an instance of that tag. CFERROR, CFFILE, CFHTTP, CFCATCH and many other tags all return such dedicated variable scopes. These specialized scopes are generally read-only and only applicable to development with the tags that produce them. Because of this they will not be detailed in this guide.

17 Current Sessions; Time: 17:19:44 06-01-2009; Tick: 469