Whatever message this page gives is out now! Go check it out!

GetApplicationMetadata

Last update:
May 18, 2026

Description

Returns a struct containing the per-application settings for the current application, as resolved from Application.cfc or Application.cfm. The returned struct includes: - settings explicitly configured in the application - nested application setting groups such as cache, REST, serialization, security, session cookie, SMTP, Java, and data sources - default values for settings that are not explicitly configured
If you have turned on Enable Global Script Protection in ColdFusion Administrator (Server Settings > Settings), the value returned is the default scopes protected (Form, URL, CGI, or Cookie). If you specify an invalid value, none, or if Enable Global Script Protection is turned off in ColdFusion Administrator, none is returned.
If you have specified memory limit for VFS in ColdFusion Administrator and if Memory Limit per Application for In-Memory Virtual File System (Server Settings > Settings) has a value lesser than what you have specified in the Application.cfc (this.inmemoryfilesystem.size), then the returned value is the one specified in the ColdFusion Administrator and not the Application.cfc.
If ColdFusion does not find the Application.cfc/Application.cfm, ColdFusion searches for the application in the order in which you have set Application.cfm/Application.cfc lookup order (ColdFusion Administrator > Server Settings > Settings). If no application is found, an empty struct is returned.

Returns

A struct containing all per-application settings for the current application.
The struct can contain both top-level settings and nested structures. It includes values explicitly set in Application.cfc/Application.cfm, and also default values for settings that are not explicitly configured.

History

ColdFusion (2025.0.08): Enhanced getApplicationMetadata() to return all per-application settings, including nested structures and default values for settings that are not explicitly configured.
Added in ColdFusion 10.

Category

Syntax

Usage

Use this function to inspect the effective application configuration at runtime. The returned struct includes:
  • Simple application settings such as name, timeout, datasource, and sessionManagement
  • Nested settings, such as cache.querySize, restSettings.restEnabled, serialization.serializeQueryAs, sessionCookie.domain, smtpServerSettings.server, javaSettings.loadPaths, and datasources
  • Default values for settings that are available to the application but are not explicitly set in Application.cfc/Application.cfm Both dot notation and bracket notation can be used to access nested values. If the application is defined with minimal configuration, for example only this.name, the function still returns the available per-application settings with their default values.
Common nested groups in the returned struct include: -
  • CACHE
  • RESTSETTINGS
  • SERIALIZATION
  • SECURITY
  • SESSIONCOOKIE
  • SMTPSERVERSETTINGS
  • JAVASETTINGS
  • DATASOURCES
getApplicationMetadata()
Example
The example shows how you can access application settings in the CFM using the function getApplicationMetadata:
Application.cfc
<!--- Application.cfc --->
<cfscript>
this.name = "myApp";
this.applicationTimeout = createTimeSpan(0,0,30,0);
this.sessionManagement = true;
this.datasource = "cfartgallery";
this.cache.querySize = 100;
this.restSettings.restEnabled = true;
this.serialization.serializeQueryAs = "row";
this.sessionCookie.secure = true;
this.javaSettings = {
    loadPaths = [expandPath("./lib")],
    loadColdFusionClassPath = false,
    reloadOnChange = true
};
</cfscript>
 
<!--- AppMetaData.cfm --->
<cfscript>
metadata = getApplicationMetadata();

writeDump(metadata);

// Access simple settings
writeOutput(metadata.NAME & "<br>");
writeOutput(metadata.TIMEOUT & "<br>");

// Access nested settings
writeOutput(metadata.CACHE.QUERYSIZE & "<br>");
writeOutput(metadata.RESTSETTINGS.RESTENABLED & "<br>");
writeOutput(metadata.SERIALIZATION.SERIALIZEQUERYAS & "<br>");
writeOutput(metadata.SESSIONCOOKIE.SECURE & "<br>");

// Bracket notation also works
writeOutput(metadata["CACHE"]["QUERYSIZE"] & "<br>");
writeOutput(metadata["RESTSETTINGS"]["RESTENABLED"] & "<br>");
</cfscript>
 
AppMetaData.cfm
writedump(getApplicationMetadata());   </cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page