learning on how to use a request scope on variables but still confuse on
certain things:
If I'm setting a variable in application.cfm this way: <cfset MyVar_1
="#Now()#">. Then everytime my application is run, MyVar is created and this
variable will be available for any template within this application.
Using request scope, I don't have to set MyVar variable in the application.cfm
anymore.
I can set any variable to this scope in any template.: <cfset request.MyVar =
"#Now()#">
Once this template is run, this variable is created and from that point on,
MyVar variable can be access from any template within the application and for
the life of this application, just like session scope.
Does my understanding to request scope correct?
This bring me to the next question: What is the different between session and
request scope then?
MaryJo - 31 Aug 2006 23:48 GMT
No, request variables do NOT exist through the session, only for the single
page request (hence the name). So they do not exist in server memory once the
page is served, and do not "time out" like session variables do. It may seem
like a session variable if you set it in application.cfm but that's only
because it is getting re-created for each request.