> I tried placing the MRU value into both session and client
> variables, and enabling client and session variables in the
> CFApplication tag, but I just got an error.  

As Mike Tangorre mentioned, if you want to use Client variables you will
need to specify where Client variables will be stored. You can either do
this using the CLIENTSTORAGE attribute of the CFAPPLICATION tag, or you can
specify a default storage location within the CF Administrator.

However, I would generally recommend that you not use both Client and
Session variables. Usually, I think you're better off just using one or the
other, depending on the needs of your application. For most relatively
simple applications, Session variables are your best bet. I'm
oversimplifying a bit here, of course. So, what happened when you tried to
use Session variables?

Remember that they also need to be enabled within the CF Administrator and
within your CFAPPLICATION tag using the SESSIONMANAGEMENT attribute.

> Also, the most logical place for me to put an assignment for this
> variable is in a CFC, but I see that Mr. Corfield does not recommend 
> doing this:
>
> "It's not that CFCs cannot access scope variables, just that they
> should not in general (since it breaks encapsulation). The general
> approach is to create a CFC whose sole job is to 'wrap' the scope
> access so as to hide it from the rest of the app."
>
> ...
> 
> So where/how can I create a variable that persists this information?

If you're using the Client scope, I suspect you'll get a little less value
out of the idea of encapsulating access to it within a CFC, since the Client
scope itself isn't stored in memory beyond a single page request, but rather
is refetched for each page request from whatever storage location you
specified. If you're using the Session scope, I would wholeheartedly endorse
Mr. Corfield's recommendation.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188856
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to