If you use CF8, "there is a function for this". :)
client side : use cfajax tags that populate the view (i.e. cfdiv, cfwindow, cfgrid, cfinput ...)
server side : use VerifyClient() in your .cfm template
OR:
client side : use <cfajaxproxy> to build JS for the remote CFC proxy
server side : use <cffunction name="remoteMethod" access=remote verifyClient="true">
Henry source share