Take a look at this to give you some ideas on working with application and session data:
http://learn.objectorientedcoldfusion.org/wiki/Accessing_a_Users_Session_Data <http://learn.objectorientedcoldfusion.org/wiki/Accessing_a_Users_Session_Data> Kevan On 19 February 2010 17:22, crippe crippe <crippe...@hotmail.com> wrote: > > I am building an application that loads all my cfc objects into the > application scope in the onApplicationStart function like so: > <cfset Application.components[variables.thisComponentVarName] = > CreateObject("component",variables.thisComponentRelativeLoc) /> > > (notice i am not calling the init method, but let me know if I should. The > init method simply returns "this" <cfreturn this />) > > One of the components that gets loaded is the sessionHandler, an object > that deals with getting/setting session vars. I load it into the session > scope like this: > <cfset session.sessionHandler = > Application.components.controller_sessionHandler.init() /> > My expectation in doing that is that I would get a new instance of the > sessionHandler object loaded into the session, however, it seems that CF > continues to simply point to the shared application scoped object b/c all > sessions seem to be sharing the same set of vars. If I alter one in one > session I can see the change in a different browser session. > > Can anyone explain why this is happening and if I need to change the way I > am loading the objects into App memory or instantiating them. I am worried > that if this is happening in the session scope it is also happening with > other cfc's in the application scope, such as when I call their init > functions within a request - is it possible that it will alter the data for > other requests if they are accessing the cfc at the same time? > > Worried, please help! > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330945 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4