1) Easy way:
<cflock scope="session" type="readOnly" timeout=3>
<cfset mySession = duplicate(session)>
</cflock>
However - you said you wanted 'variables' - not just a copy, so version
2...
2)
<cflock scope="session" type="readOnly" timeout=3>
<cfloop item="key" collection="#session#">
<!--- CF5 way --->
<cset "#key#" = session[key]>
<!--- CFMX way --->
<cfset Variables[key] = session[key]>
</cfloop>
Note - this assumes all session keys are valid. If you try this
on CF5 and have session[" kiss my rear"]=1 it will fail.
=======================================================================
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: Stephenie Hamilton [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 18, 2002 2:45 PM
> To: CF-Community
> Subject: Converting session vars to local vars
>
>
> I am trying to loop over a session struct and convert the
> session vars to local vars (about 25 key/value pairs) to
> manipulate them then insert into db, but can't seem to get
> the syntax right to convert them to local vars. I don't want
> to have a bunch of cflocks on this page and thought this
> would be easier than converting them individually in a
> cfscript statement.
>
> tia
>
> ~~
> Stephenie
>
>
>
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists