Title:
GetApplicationMetaData() sometimes returns data from a different application
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/Duplicate
Reporter/Name(from Bugbase): Richard Davies / Richard Davies (Richard Davies)
Created: 05/26/2016
Components: Core Runtime
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Final /
Priority/Frequency: Major / Some users will encounter
Locale/System: English / Win 2008 Server R2 64 bit
Vote Count: 0
Duplicate ID: CF-4155785
Problem Description:
GetApplicationMetaData() is supposed to return a struct containing metadata properties of the current application, but sometimes it returns data from a different application. When this happens, the properties such as name and sessionManagement, etc. are incorrect.
Steps to Reproduce:
Run this code multiple times and look for odd behavior. The behavior is not consistent and I have not been able to determine exactly what condition(s) cause it to return data from the wrong application, but it seems to happen more frequently right after I update the .cfm file or when I first access the page (so maybe it has something to do with when CF compiles the code into Java bytecode or initializes the application, etc.)
<cfapplication name="sessiontest" sessionmanagement="true" />
<cfscript>
public Boolean function isPersistentDataEnabled() {
if (ListFirst(server.coldfusion.productversion,",") GTE 10) {
return getApplicationMetaData().sessionManagement; // CF10 compatible
} else {
return application.getApplicationSettings().sessionManagement;
}
}
</cfscript>
<cfoutput>
<cfset Session.test = "Session exists">
<cfdump var="#Application#">
#isPersistentDataEnabled()#
<cfdump var="#getApplicationMetaData()#">
<cfdump var="#Session#">
</cfoutput>
Actual Result:
getApplicationMetaData().name = "PortlandOnline"
getApplicationMetaData().sessionManagement = "NO"
(See attached screenshot)
Expected Result:
getApplicationMetaData().name = "sessiontest"
getApplicationMetaData().sessionManagement = "YES"
(See attached screenshot)
Any Workarounds:
Unknown.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4158130
External Customer Info:
External Company:
External Customer Name: Richard Davies
External Customer Email:
External Test Config: My Hardware and Environment details:
System Information
Server Details
Server Product ColdFusion
Version 10,0,19,298511
Tomcat Version 7.0.68.0
Edition Enterprise
Operating System Windows Server 2008 R2
OS Version 6.1
Update Level /D:/Applications/CFusion/cfusion/lib/updates/chf10000019.jar
Adobe Driver Version 4.1 (Build 0001)
JVM Details
Java Version 1.7.0_15
Java Vendor Oracle Corporation
The sessiontest.cfm file I used for this test is located in our IISRoot\PortlandOregon directory, which also contains an application.cfm that defines a "PortlandOregon" application. The "PortlandOnline" application is defined in IISRoot\PortlandOnline\application.cfm. The ColdFusion administrator has a mapping that maps "/" to "IISRoot/PortlandOnline". So for whatever reason, GetApplicationMetaData() in sessiontest.cfm sometimes doesn't return data for the sessiontest application, or even the PortlandOregon application, but is instead returning data for the PortlandOnline application.
Attachments:
- May 27, 2016 00:00:00: 1_actual.png
- May 27, 2016 00:00:00: 2_expected.png
Comments: