Hey all,

Had an interesting conundrum today.  I wanted to param a session variable in 
Application.cfc, so naturally I placed the <cfparam name="session.myvar" 
default="false"> in onSessionStart.  I quickly realized that this does not 
catch people whose sessions are already in progress.  Since we pretty much 
have sessions running on our production server 24/7, there is never a time 
when I could post the updated Application.cfc and not get a bunch of "myvar 
not defined in session" errors.

Solutions would be to a) restart the server or otherwise end all sessions 
(not viable), b) use structKeyExists(session,"mvar") anywhere the variable 
is used, or c) place the <cfparam name="session.myvar"> in onRequestStart. 
I chose c) as it is the most "DRY (Don't Repeat Yourself)" to implement, but 
I'm wondering if it is bad practice to param a session variable in 
onRequestStart, or if other folks have been in a similar situation and done 
anything differently.

-- Josh 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285735
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to