>I'm building a cart-like application where I intend to store the
>(usually anonymous) user's intra-session web site state in a database
>table.  Using cfid and cftoken are the obvious choice to use to ID a
>given user's state (I do realize that it would be system-unique and
>wouldn't follow the user across computers, which is fine) when stored
>in the database, but I feel like my understanding of how (and when)
>CFID's and CFTOKEN's are created is incomplete.  Is there a
>comprehensive guide to the how's and why's of cfid and cftoken
>available online?
>
>Thanks,
>
>Pete

Pete,

I'll take a crack at this based on all that I recall and about 14 years of 
experience with ColdFusion.  =)

CFID and CFTOKEN are set as persistent cookies by ColdFusion.  This means that, 
assuming the end user has cookies enabled, the cookies are set and will retain 
the originally set value until they are specifically cleared by the end user.  
So, if a user visits your site for the very first time, ColdFusion will assign 
a new set of CFID and CFTOKEN values via a pair of cookies.  CFID is assigned 
sort of like an identity or autonumber, while CFTOKEN may be set in two 
different ways.  By default, CFTOKEN will be set as an 8-digit random number.  
However, there's an option in the ColdFusion Administrator under the "Settings" 
menu to assign CFTOKEN as a UUID instead of a random number.

And if you're dealing with a cluster of servers that might have unique host 
names but the same domain name, there's a boolean argument for the 
<cfapplication> tag called "setdomaincookies" (default: false) which will set 
the CFID and CFTOKEN cookies as domain-level cookies so that any hostname on 
that domain can read/write/share them.

Back many years ago, it used to be that there was a section in the registry 
where the seed value for CFID was stored and could be altered or reset.  These 
days, I'm not sure off the top of my head if that still exists.

Hope that helps.

-Tyson

--
Tyson Vanek
Principal Consultant
Webapper Services, LLC
http://www.webapper.com/ 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317763
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to