Tom Hubbard
Tom Hubbard

Reputation: 16129

Does Coldfusion have a "Global" structure

Does Coldfusion have a "Global" structure where the expressions global["FORM"], global["URL"], global["APPLICATION"], global["SESSION"], etc. are valid?

Upvotes: 0

Views: 379

Answers (3)

duncan
duncan

Reputation: 31912

no. Form, URL, Application, Session etc are all 'global' already. The underlying Java has got this, if you just want to dump out all the scopes at once:

<cfdump var="#getPageContext().getBuiltInScopes()#">

Or at least that used to work, but in CF9 you have to use this instead:

<cfdump var="#getPageContext().getCFScopes()#">

Upvotes: 10

Yuri Vorontsov
Yuri Vorontsov

Reputation: 11

My take is that you are out of luck with FORM and URL scope. You can access all user sessions running on a CF instance using SessionTracker Java object:

<cfset sessionTrackerObj = createObject("java","coldfusion.runtime.SessionTracker")>
<cfoutput><p>There are #sessionTrackerObj.getSessionCount()# active sessions</p></cfoutput>

Dump the sessionTrackerObj to view its structure.

The same goes for the APPLICATION scope:

<cfset appTrackerObj = createObject(“java”,”coldfusion.runtime.ApplicationScopeTracker”)>

Enjoy!

Upvotes: 0

Adam Tuttle
Adam Tuttle

Reputation: 19804

Sorry, but the answer is, "Nope." (am I up to 30 characters yet?)

Upvotes: 5

Related Questions