Toni,
> If visitor accept cookies the problem is solved.
> If visitor don't accept cookies, can i store cfid & cftoken in a session
> variable to no have to pass the CFID and CFTOKEN on the URL?
> What are the problems of session variables? Client vs Session variables?
>
You can't use session variables instead of CFID and CFTOKEN, because
sessions also use CFID and CFTOKEN to reference the session, as I decsribed
before.
The major advantage of client variables over session variables is that you
don't have to do any cflocking when you use CLIENT variables.
The next advantage is that client variables can persist longer and are more
stable than session variables. eg. You use a session variable for a
shopping cart, the user adds a number of items to their cart and then stops
to answer an email, get interrupted by the phone etc. They forget about
their cart for a time and your CF Server times out their session. When the
user comes back to the browser window and starts shopping again all the
items in their cart are lost. Using client variables you won't get this
issue because the variables that store your cart exist in the client
database until you delete them in your application, you cause them to time
out in your application or CF deletes them because they have been inactive
for over 90 days (default setting).
> >There are ways that you can determine whether a user has cookies
> enabled or
> >not and then decide whether to append the CFID and CFToken to the URL.
>
> Can you tell me where can i find some ways to determine that?
>
Off the top of my head, something like this with test to see if cookie are
enabled....
<cfset cookie.isSet = "This is a test">
<cfif Isdefined("cookie.isSet") and cookie.isSet is "This is a test">
Cookies are accepted....
</cfif>
I should mention that this particular piece of code will only work in cf
4.5.x I believe, because in cf4.5 the second condition will not be processed
if the first condition fails and the conditional operator is "AND". In
previous versions the whole of the IF statement is processed.
Hope that helps.
Regards
Stephen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists