Application variables are available to all pages within an application, that is, pages that have the same application name. Because application variables are persistent, you easily can pass values between pages. You can use application variables for information including the application name, background color, data source names, or contact information.
You set the application name in the cfapplication
tag, normally on your application's Application.cfm page. The application name is stored in the Application.applicationName
variable.
Unlike client and session variables, application variables do not require that a client name (client ID) be associated with them. They are available to any clients that use pages in the application.
Caution: To preserve data integrity, put code that uses application variables inside cflock
tags. For information on using cflock
tags see Locking code with cflock.
The following sections describe how to configure and use application variables.