On 12/21/00, Mark Smeets penned:
>From the looks of it, you don't need Last User and Current User and the
>cookie part is it. As far as I can remember from the book those are just
>little "cutesy" pieces of code.
>
>I guess another question I have is, do I just simply have to say yes to
>session and client management and I can start storing my variables or do I
>need to set this up?

Basically, what Ben does there is check to see if session.rollcount 
is defined. If it's not,then  this is the first time the site has 
been accessed (for this session) and he sets a test cookie and a 
query string (session.addtoken) which is client.cfid and 
client.cftoken. Every link on the site should have:

page.cfm?#session.addtoken#

appended to the end. On the first click, the client.cfid and 
client.cftoken will be passed as a query string, assuring that the 
session will remain active even if cookies are off. session.rollcount 
will then be defined and he checks for the test cookie. If the test 
cookie exists, then cookies are active and he sets session.addtoken 
as an empty value, which will make your link look like page.cfm?. If 
not, then cookies are not active and the link remains 
page.cfm?cfid=53534&cftoken=46373872828, or whatever, thus keeping 
the session alive for the next click and so on and so on.

So, to answer your question. If you want people with cookies disabled 
to be able to store session variables, such as items in a shopping 
cart, then yes, you need to pass cfid and cftoken as a query string 
on every click. If not, then no you don't. Or you could simply bypass 
all the checks and pass the query string anyway. The values of cfid 
and cftoken will have the same values of the cfid and cftoken cookies 
if they are set.
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to