Skip to content

Instantly share code, notes, and snippets.

@JamoCA
Last active October 7, 2022 21:50
Show Gist options
  • Save JamoCA/f2ae1a8140f857aa4fc264a5474b56ad to your computer and use it in GitHub Desktop.
Save JamoCA/f2ae1a8140f857aa4fc264a5474b56ad to your computer and use it in GitHub Desktop.
Using ColdFusion Safe Navigation to identify scope class names. CFML
<!--- 2022-10-07 by James Moberg / SunStar Media
Requires ColdFusion 2016+ or Lucee CFML
GIST: https://gist.github.com/JamoCA/f2ae1a8140f857aa4fc264a5474b56ad
--->
<h2>Identify Scope Class Names using ColdFusion Safe Navigation Operator</h2>
<cfoutput>
application = #application?.getClass()?.getName()#<br>
form = #form?.getClass()?.getName()#<br>
url = #url?.getClass()?.getName()#<br>
session = #session?.getClass()?.getName()#<br>
client = #client?.getClass()?.getName()#<br> <!--- "Client" throws an error in Lucee if not enabled. To bypass, comment out or remove --->
server = #server?.getClass()?.getName()#<br>
cookie = #cookie?.getClass()?.getName()#<br>
cgi = #cgi?.getClass()?.getName()#<br>
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment