Just be careful with this code:

<cfset variables.user = session.user>

If session.user is a structure then you are creating a pointer, not a
copy. You would need to use this instead:

<cfset variables.user = duplicate(session.user)>

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, June 12, 2002 8:56 AM
> To: CF-Talk
> Subject: Re: Absolutly neccesary to cflock session variables
> 
> 
> If the session is locked prior to calling 
> isdefined('session.myvariable') 
> it should throw an error.  Anytime I have a session variable, 
> I usually 
> try to make it a structure within a variable, that way when I 
> do <cfset 
> variables.user = session.user>, I've got the whole structure (read: 
> variables.user.myvariable) in one simple statement and I can 
> do a readonly 
> cflock scope on it to pull it local to the page.
> 
> Once it's a local variable 
> isdefined('variables.user.myvariable') is no 
> longer needed to be locked.
> 
> ~Todd
> 
> On Wed, 12 Jun 2002, Brian Eckerman wrote:
> 
> > Is it absolutly necesary to cflock session variables.
> > ex. when doing an IsDefined(session.myvariable).
> > How could it hurt to not use them?
> > 
> 
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to