Skip to main content
October 9, 2009
Question

CGI.Query variable

  • October 9, 2009
  • 1 reply
  • 509 views

I was reviewing some older code and found the reference to a variable called "query" as in #query# . At first I thought it was a local variable since they are the usual variables to be left unscoped. But I couldn't find a place where it was defined. When I display the value it is identical to cgi.query_string.  I was puzzled as to what scope this unscoped variable was coming from.  I eventually found it appears to be cgi.query yet this is not documented anywhere that I have found.  If I cfdump CGI it doesn't list it.  But I do a cfoutput of it and it displays the same thing that cgi.query_string does.

Can someone please explain why this is not documented anywhere.  I have no idea why someone would rely on using an undocumented cgi variable unless it was commonly used  at some point in CF's past.

    This topic has been closed for replies.

    1 reply

    Inspiring
    October 9, 2009

    You should understand that CGI variables are not created by CF, they are

    created by the web server; CF is merely reporting the values exposed by the

    web server. So it's not CF's job to document them. There are a number of

    "standard" CGI variables that all web servers expose (this is possibly part

    of the HTTP specification, I'm not sure), but there's nothing to stop the

    web server exposing any other value that might be appropriate to the system

    involved (like for example single-sign-on credentials).

    As to why your webserver exposes this CGI.QUERY value, who knows. Have you

    read the application's documentation? It might be explained there.

    --

    Adam