Not sure what your question is..but then again I have had hardly any sleep
;-) but if it's a way of copying back and forth between the request and
session scope..this should work (and there are even easier ways!)
<cfparam name="attributes.action" default="session2request"><!--- required
--->
<cfswitch expression="#attributes.action#">
<!--- add session variables to the request scope --->
<cfcase value="session2request">
<cflock scope="SESSION" type="READONLY" timeout="15">
<cfloop collection="#session#" item="key">
<cfset request[key] = session[key]>
</cfloop>
</cflock></cfcase>
<!--- add request variables to the session scope --->
<cfcase value="request2session">
<!--- remove request variables that should not be added to
the Session scope --->
<cfset excludeList = "hideScript,hideTimeScript">
<cfloop list="#excludeList#" index="i">
<cfset StructDelete(request, i)>
</cfloop>
<cfloop collection="#request#" item="key">
<cflock scope="SESSION" type="EXCLUSIVE"
timeout="15">
<cfset session[key] = request[key]>
</cflock>
</cfloop></cfcase>
<cfdefaultcase>
The "action" ATTRIBUTE you have passed in is invalid.
<cfabort></cfdefaultcase>
</cfswitch>
-----Original Message-----
From: Matt Horn [mailto:[EMAIL PROTECTED]
Sent: 05 November 2003 09:35
To: [EMAIL PROTECTED]
Subject: [ cf-dev ] Request scope
Hi
for as long as I have been writing Cold fusion code I have done this:
<cflock scope="session" timeout="10">
<cfset request.userId= session.userId>
<cfset request.productionhouseId = session.productionhouseId> </cflock>
but everything works fine without the request scope
<cflock scope="session" timeout="10">
<cfset userId= session.userId>
<cfset productionhouseId = session.productionhouseId> </cflock>
so my question is this
Am I correct in setting session variables down to Request scope
or will the other way work just as well?
and if so .. why even have a request scope?
Matt *Newbie
|\--------------------/|
Matt Horn
Web Applications Developer
Ph:+2782 424 3751
W: http://www.matt-horn.org
E:[EMAIL PROTECTED]
|\--------------------/|
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]