Using server variables

Server variables are associated with a single ColdFusion server. They are available to all applications that run on the server. Use server variables for data that must be accessed across clients and applications, such as global server hit counts.

Server variables do not time out, but they are lost when the server shuts down. You can delete server variables.
Server variables are stored on a single server. As a result, do not use server variables if you use ColdFusion on a server cluster.

You access and manipulate server variables the same way use Session and application variables, except you use the variable prefix Server.

Note:

Place code that uses server variables inside cflock_ tags in circumstances that could result in race conditions from multiple accesses to the same variable. You do not have to lock access to built-in server variables._

ColdFusion provides the following standard built-in read-only server variables:

server.coldfusion

<cfscript>
    val=server.coldfusion
    writeDump(val)
</cfscript>
Variable Description
InstallKit The OS on which ColdFusion is installed.
appserver The application server that ColdFusion is running on, for example, Tomcat.
expiration The expiration date of ColdFusion license.
productlevel Indicates if ColdFusion on your machine is Developer or Enterprise.
productname ColdFusion server.
productversion The ColdFusion version that is currently running.
rootdir Directory under which ColdFusion is installed, such as C:\<cfhome> or /opt/<cfhome>/cfusion .
supportedlocales The locales, such as English (US) and Spanish (Standard), supported by the server.
updatelevel The current update (hotfix) level applied to the installed version of ColdFusion.

server.os

<cfscript>
    val=server.os
    writeDump(val)
</cfscript>
Variable Description
additionalinformation The OS on which ColdFusion is installed.
arch The processor architecture, such as x64 or ARM.
buildnumber The expiration date of ColdFusion license.
name The name of the OS where ColdFusion is running.
version The version of the OS.

server.system.environment

<cfscript>
    val=server.system.environment
    writeDump(val)
</cfscript>

Lists various environment variable names that describe system-level settings and configurations. These include identifiers for system paths (like ProgramFiles, SystemRoot, Path), processor details (PROCESSOR_ARCHITECTURE, PROCESSOR_IDENTIFIER), operating system information (OS, NUMBER_OF_PROCESSORS), user-specific directories (APPDATA, USERPROFILE), and configuration flags (for example, _PSLockDownPolicy, ZES_ENABLE_SYSMAN). These variables provide essential metadata used by the operating system and applications to understand the system environment, manage resources, and find execution contexts.

Get help faster and easier

New user?