Topic: The Cookie Tutorial


maquiladoras    -- 05-16-2003 @ 12:11 PM
  Not so much a bug report
more of a query


<cfif IsDefined("cookie.password")>
   <!--- a cookie exist, so let's put in this password automatically into the form --->
    <cfset password = cookie.password>
<cfelse>
    <!--- a cookie DOES NOT exist, so let's put a blank value in the password field --->
   <cfset password = cookie.password>
</cfif>


Could you not just get rid of the cfif and just put

<cfset password = cookie.password> ????

----------------------------
"If you hear hoof beats, think
horsey, not zebra"
----------------------------


CJ    -- 05-16-2003 @ 2:02 PM
  actually...i *think* that should be:

<cfif IsDefined("cookie.password")>
   <!--- a cookie exist, so let's put in this password automatically into the form --->
    <cfset password = cookie.password>
<cfelse>
    <!--- a cookie DOES NOT exist, so let's put a blank value in the password field --->
   <cfset password = "">
</cfif>

not 100% sure about that, as it was not my tutorial...and I rarely use cookies.  but what i see in your post above doesn't seem to make much sense (as far as why there's even a conditional there...and how you can set the password to be cookie.password, if cookie.password does not exist (as in the second condition)).





CJ
@ #coldfusion/DALNet
http://charlie.griefer.com


Webmaster    -- 05-16-2003 @ 3:07 PM
  Ooopps! I thought I had changed it to that.. My bad! Smile

I hardly ever use cookies myself, but the tutorial was a requested one. I overlooked it, well I corrected it now! Smile

Thanks for pointing that out!

Thanks,
Pablo Varando

=====================================================


EasyCFM.COM ColdFusion Forums : http://archive.easycfm.com/forums
Topic: http://archive.easycfm.com/forums/viewmessages.cfm?Forum=11&Topic=834