> Hi once again. I'm about to start going back (grrrr) and locking all
> my session, application variables, etc properly. Got a couple
> question.
>
> 1. Suppose I'm creations a session variable FROM session variables.
> For instance:
>
> I have: session.subtotal, session.tax, and session.shipping. I want
> to create a total:
>
> <cfset session.total = session.subtotal + session.tax +
> session.shipping>
>
> What kind of lock would go around that? Or would it be best to set a
> local variable inside a Readonly lock then set the session.total
> inside an exclusive lock from the local variable.
Just one TYPE="EXCLUSIVE" lock will do just fine for this. You don't want to
make things more complicated than they need to be.
> 2. I've got a million instances of passing cfid and cftoken as
> session.id if cookies are turned off as per Ben Forta's examples in
> his book.
>
> a href = "somepage.cfm?#session.id#"
>
> That means I need to put a readonly lock around all of those,
> correct? My question is (actually a two part question).
>
> If I have a block of these, such as a text menu, should I put one
> lock around the entire block? Or should I lock each link separately?
If they're all together, you're probably better off locking them all within
one lock.
> Part B of this question: Since I'm going through the hassle of
> checking for the existence of cookies, AND passing the session.id,
> would it be better to just pass
> cfid=#client.cfid#&cftoken=#client.cftoken# and not worry about if
> cookies are turned on? I suppose even if I do that, I should put a
> readonly lock around the links anyway, huh?
The Client scope doesn't need to be locked. You might consider copying any
session data that you absolutely know you're going to need on each page to
the Request scope; you can do this in application.cfm, and then you don't
have to worry about sprinkling CFLOCKs throughout your pages - you'd just
change the scope of the affected variables.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.