Tokenless location() Without Parameters

Both Railo and ColdFusion have added a builtin 'location' function in recent versions, and like their CFLOCATION counterpart, the default behaviour is to append the jsessionid/CFIDE/CFTOKEN tuple to the URL when redirecting.  I find this rather annoying, and it's even worse since FB3lite has a 'location' function which defaults it to false.  Unfortunately there isn't a way to use the FB3lite UDF in place of the engine built-in, so when you upgrade the server under a FB3lite app, suddenly the way your redirects work changes.

Fortunately, Railo implements the 'location' function as a CFML template, so you can easily go change the default.  If you install the WAR version the template is here:

/WEB-INF/lib/railo-server/context/library/function/location.cfm

If you install the bundled version, the 'railo-server' directory will be outside the webroot, typically here (thanks Todd):

{installation-dir}/railo/railo-server/context/library/function/location.cfm

Changing this file requires restarting your Railo webapp as the files are loaded once on startup.  As you'll quickly notice, there are a bunch of functions and tags that are implemented this way, so you can easily modify any or all of them to customize your environment.  Just be careful when you upgrade your Railo, as your changes will be overwritten.

One response to “Tokenless location() Without Parameters”

  1. Todd Rafferty

    Depends on which bundle you installed and how you installed it. Should typically be: {installation dir}/railo/railo-server/context/library/function/location.cfm. The key directory to look for is the "railo-server' directory which is unique in a non-war railo instance (Common Class Loader / Resin install, etc).