cacheGetSession

Lets you retrieve the underlying cache object to access additional cache functionality that is not implemented in the tag cfcache.

Note: Caution! Using the cacheGetSession function might pose security vulnerabilities. If you wish to disable the usage of this function, add it to Sandbox Security.

cacheGetSession(objectType) → returns any

This function requires Adobe ColdFusion 9.0.1 and up. Not supported on Lucee, OpenBD, etc.

cacheGetSession Argument Reference

objectType string
Required

Any of the following values: object, template, or name of the user-defined cache
Values:
  • object
  • template

isKey boolean
Default: false

Set to true if objectType is user-defined cache.

Examples sample code invoking the cacheGetSession function

<!--- put an object into user-defined object cache --->
<cfset cachePut("cache1","hello",15,15)>

<!--- get underlying user-defined object cache --->

<cfset objectCache = cacheGetSession("object",true)>

<!--- get/print user-defined object cache properties --->

<cfdump var = "#objectCache.getCacheConfiguration()#">

Expected Result: cache object


Fork me on GitHub