DEV Community

James Moberg
James Moberg

Posted on

ColdFusion CGI Scope is not Read-Only

I've was been always under the impression that the ColdFusion CGI scope was "read-only". Apparently, it's not... unless you use Lucee CFML.

I read about a developer in the Adobe Support Community having issues migrating their CF2016 application to CF2021 as the CGI scope was empty. This gave me some cause for concern as that's the same upgrade path that we're taking.

Their application passed the CGI scope to a UDF to sanitize certain keys and the global CGI scope was being cleared when using structClear on the local-scoped variable structClear(local.copyofCGIScope).

Now I've got to go through my codebase and ensure that we aren't accidentally modifying CGI anywhere. :(

Top comments (0)