An alternative point of view, the Session scope does have good practical
usability and is significantly faster in most cases that constantly querying
a database for each client request.  We use this methodology in the
ColdFusion applications where we use the Session scope.  We write, read and
changes all vars in the Request scope.

in application.cfm:
cflock timeout="30" throwontimeout="No" type="READONLY" scope="SESSION"
cfset structappend(request,Duplicate(session))
/cflock

in onrequestend.cfm
cflock timeout="30" throwontimeout="No" type="EXCLUSIVE" scope="SESSION"
cfset structAppend(session,Duplicate(request))
/cflock

The one thing to watch for here is where Cflocation or Cfabort are used as
the onRequestEnd.cfm file will not be run in that case and any variables
created or changed in the current Request will not be in the Session scope
the next time Application.cfm runs.  We deal with this by including
onRequestEnd.cfm directly before any Cflocation or Cfabort tags run.

Kind Regards - Mike Brunt, CTO
Webapper
Blog http://www.webapper.net
Web site http://www.webapper.com
Downey CA Office
562.243.6255
AIM - webappermb

Web Application Specialists


-----Original Message-----
From: paul smith [mailto:[EMAIL PROTECTED]]
Sent: Saturday, December 14, 2002 9:49 AM
To: CF-Talk
Subject: RE: For the gurus: Question about state management with CLIENT
sc ope


It's intent is one thing.  It's practicality is another.

I never use session scope to maintain state.  I use client scope and store
client variables in a database.  I let the database worry about what it is
good at - locking, so I don't have to worry about it.

best,  paul

At 04:54 PM 12/12/02 -0500, you wrote:
>The Client scope isn't really intended to behave the same way as the
Session
>scope - it's intended more for long-term user data storage, rather than
>storing data during an individual visit.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to