cfloop over cfif
I have a group of variables that I want to perform the same cfif statement for. I don't know the correct syntax for it and can't seem to find it anywhere. I know the code below doesn't work, but it shows what I'm trying to do.
How do I combine text and a variable together such as URL.#cookieName#?
<cfloop index="cookieName" list="myPro,myPub,myUni,myLes,peerPro,peerPub,peerUni,peerLes">
<cfif StructKeyExists(URL, "#cookieName#") AND URL.#cookieName# EQ "t" AND COOKIE.#cookieName# EQ "on">
<cfset COOKIE.#cookieName# = "off">
<cfelseif StructKeyExists(URL, "#cookieName#") AND URL.#cookieName# EQ "t" AND COOKIE.#cookieName# EQ "off">
<cfset COOKIE.#cookieName# = "on">
</cfif>
</cfloop>
