ColdFusion CGI variables and Spiders
What's wrong with this bit of code?
1<cfset languages = CGI.HTTP_ACCEPT_LANGUAGE>
Well nothing as long as the page is viewed with a browser. However a cgi variable in your code may not exist if a spider rather than a browser looks at your site. This includes spiders like google. Your site may not be indexed by search engines if you don't handle CGI variables correctly.
Testing for CGI variables
Because some browsers do not support some CGI variables, ColdFusion always returns True when it tests for the existence of a CGI variable, regardless of whether the browser supports the variable. To determine if the CGI variable is available, test for an empty string, as shown in the following example:
<cfif CGI.varname IS NOT "">
CGI variable exists
CGI variable does not exist