Differences in Application name between CF 8 and Railo

{ Posted By : Eric Cobb on February 24, 2009 }
1124 Views
Related Categories: Railo, ColdFusion

This was an interesting little "gotcha" I stumbled on tonight. It seems that using a dash in the application name will throw an error in CF, but works fine in Railo.

So, the following cfset tag will work fine in Railo:

<cfset THIS.name = "MyApp-Admin" />

But, it will throw the following error in CF 8:

Detail: Valid variable names must start with a letter and can only contain letter, numbers, and underscores.
Message: The string COOKIE.CFAUTHORIZATION_MyApp-Admin is not a valid ColdFusion variable name.

Changing the dash to an underscore works fine in both CF 8 and Railo:

<cfset THIS.name = "MyApp_Admin" />

I thought this was odd, though, as I could have sworn that I've seen a CreateUUID() used to create an application name before, and all UUIDs have dashes.

Comments