Thursday, 13 August 2009

Please log me the f**k out (coldfusion client variables)

Random code snippet, why does it take 2 lines o code to do one thing?

Trying to remove a client variable in Cold-fusion used to be as simple as DeleteClientVariable("name") but it seems as time goes on (CF6,CF7,CF8) this isn't enough, you need to do it twice.

<cfloop list="#structkeylist(client)#" index="i">
<cfset DeleteClientVariable(i)>
<cfset StructDelete(Client, i)>
</cfloop>

DeleteClientVariable just doesn't seem to cut it, although if I'm honest I abuse the scope of a regular basis, including such beauties as.

<cfset client['login.contact.address1']="C/O COMPUTERLINKS">
<cfset client['login.contact.address2']="Suffolk House">

0 comments:

Post a Comment