re: onSessionEnd clearing session scoped variables
IIRC, by the time onSessionEnd() is triggered, the session struct has already been cleared. ~| 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:326103 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: onSessionEnd clearing session scoped variables
I would think that those references would be garbage collected at the next GC run, so no need to do that. -- Josh -Original Message- From: Che Vilnonis [mailto:ch...@asitv.com] Sent: Tuesday, September 08, 2009 12:15 PM To: cf-talk Subject: onSessionEnd clearing session scoped variables What is the best/proper way (using CF8) to clear all session variables in the onSessionEnd method of Application.cfc? Should I clear the variables individually? Should I clear the entire session scope? Or, since I have a default session timeout, do I need any of this code at all? See below. cffunction name=onSessionEnd returnType=void output=false cfargument name=sessionScope type=struct required=true cfargument name=appScope type=struct required=false cfset structClear(arguments.sessionScope) /cffunction cffunction name=onSessionEnd returnType=void output=false cfargument name=sessionScope type=struct required=true cfargument name=appScope type=struct required=false cfset structClear(arguments.sessionScope.cart) cfset structClear(arguments.sessionScope.cartcount) cfset structClear(arguments.sessionScope.recentlyviewed) /cffunction Thanks, Che ~| 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:326104 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: onSessionEnd clearing session scoped variables
Thanks all. I just wasn't sure about the best practice... -Original Message- From: Dave Watts [mailto:dwa...@figleaf.com] Sent: Tuesday, September 08, 2009 4:27 PM To: cf-talk Subject: Re: onSessionEnd clearing session scoped variables What is the best/proper way (using CF8) to clear all session variables in the onSessionEnd method of Application.cfc? Should I clear the variables individually? Should I clear the entire session scope? Or, since I have a default session timeout, do I need any of this code at all? See below. You don't have to do anything. CF will clear them from memory for you. Dave Watts ~| 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:326114 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: onSessionEnd clearing session scoped variables
What is the best/proper way (using CF8) to clear all session variables in the onSessionEnd method of Application.cfc? Should I clear the variables individually? Should I clear the entire session scope? Or, since I have a default session timeout, do I need any of this code at all? See below. You don't have to do anything. CF will clear them from memory for you. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| 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:326112 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4