This content has been marked as final. Show 4 replies
There is only one Application scope.
For variables that are group specific, use the Client Scope.
Thanks very much and that seems to be the way to go, but can you help me to understand how things work on a shared server: -
How is it possible that on my website host's shared server for example, I can set any application variable I like and use onApplicationStart and they all apply only to my website, when there are dozens of other users all sharing ColdFusion?
First, if your host is any good at all, all the different hosting clients are not strictly sharing CF.
The host should be using CF Enterprise and running each client in their own instance.
Anyway, the application variables are controlled by the cfapplication tag or by the Application.cfc name value.
On a given server instance, each application name has its own Application scope.
Since a given set of files can only use one App tag or App cfc, they can only have one Application scope.
Anyway, the values you want are NOT constant throughout the application so they don't belong in the application scope per se.
Unless, maybe, you did something like this:
Application.UsrGroups.name = grunts
Application.UsrGroups.datasource = grunt_DB
Application.UsrGroups.name = Bosses
Application.UsrGroups.datasource = Boss_DB
But it is still probably cleaner to set the key values in the Client scope.
Thanks so much for your time. I can now fully understand what is going on and you're right the Client scope does provide exactly what I want.