> Wouldn't you actually need to use the Duplicate() function here 
> when referencing the session variable? I seem to recall past 
> discussions that the process of making a copy in this way actually 
> only created a pointer to the session variable and left you 
> vulnerable to the locking issue. Using Duplicate(), however, 
> made a true clone of the variable that was free from the locking 
> issues. As in.....
> 
>   <cfset request.session.strFirstName = 
> Duplicate(session.strFirstName)>
> 
> #############
> <!--- lock session and read name/email address --->
> <cflock scope="session" type="readonly" timeout="30">
>       <cfset request.session.strFirstName = session.strFirstName>
>       <cfset request.session.strLastName = session.strLastName>
>       <cfset request.session.strEmail = session.strEmail>
> </cflock>
> #############

If you're only copying variables containing simple values (strings,
essentially), those variables will be passed by value, meaning that when you
copy the variable, you end up with two separate variables. Queries and
structures - complex data objects - are passed by reference, meaning that
when you copy the variable, you end up with two pointers to the same
underlying data object. When copying queries and structures, you may need to
use Duplicate; when copying strings, it's unnecessary.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to