Application.cfm and CFC's

for some reason my cfc is not seeing any of the variables set
in application.cfm. Furthermore it does not see them when I use
application.cfc. I am running 6.1MX on iis5. Any info would be
helpful.
Thanks

Duke Snyder wrote:
> for some reason my cfc is not seeing any of the
variables set in
> application.cfm. Furthermore it does not see them when I
use application.cfc. I
> am running 6.1MX on iis5. Any info would be helpful.
>
> Thanks
>
In deference to Adam, I'm going to go ahead an make a guess.
Directory structure is very important here. Application.cfm
will only
apply to code that is run in the same directory or any sub
directory
there under. This applies to CFC's as well. A common idea is
to place
a CFC in some type of common folder that is outside the
normal
application structure, thus the CFC is not in the directory
structure
under which the Application.cfm file has dominion. So it will
not apply
in such a case.
If this is so, the fix is to either move the CFC so that it
is under the
Application.cfm dominion. Or to provide it it's own
<cfapplication...>
tag with the desired application name to be able to access
the desired
application scope. This can be done directly in the CFC file
or an
Application.cfm file in the CFC folder hierarchy.
Of course doing so really complicates the usefulness of
having CFCs in a
common place where they can be used by multiple applications
equally.
Thus providing a strong argument to the OOP concept of
encapsulation.
That an object (component) should not be aware of anything
outside of
itself and everything it needs to do its job should be passed
into it.
I.E. Pass the required application data into the component as
arguments
and make use of it that way.

Similar Messages

  • Difference between application.cfm and application.cfc

    Hi,
    Can anybody explain the difference between Application.cfm
    and application.cfc?
    For example:
    I have Application.cfm and Application.cfc in the same
    folder.
    /folder/application.cfm
    /folder/application.cfc
    /folder /test.cfm
    …. And I run the test.cfm.
    Which one is executed first?
    Thanks,
    Krishna

    Your last question - Which one is executed first?
    The application.cfc will be executed first if you call the
    test.cfm. The application.cfm will not get executed.
    and, about ur first question... cfm and cfc are entirely
    different. You have onRequestStart, onRequestEnd and other events
    on cfc. cfc is powerful than cfm.

  • Application Variables in application.cfm and asp

    If anyone could provide some insight into using application
    variables declared in application.cfm, but retrieved in asp code,
    it would be appreciated.
    GOAL: Retrieve values into an asp page from application
    variables in application.cfm.
    PROCESS: Defined the variables in application.cfm. On an asp
    page, defined the application variable in Window -> Bindings.
    The application variables defined in the source code show up.
    Attempt to retrieve the application variable in the asp page by
    using the command: var_destination = Application("var_name")
    It seems like whatever I try, the variable is empty. After
    looking around on the web, I also saw that the equivalent to
    application.cfm in asp is global.asa. I also tried setting up this
    file, along with the variables, did the binding, and used the same
    commands, and also was not able to retrieve any application
    variables.
    What am I missing?

    What am I missing?
    That ColdFusion and ASP.NET are different applications and do
    not share
    the same memory addresses So they are going to each have
    their one
    "application" variables.
    Blue Dragon has implemented CFML as an ASP.NET language so
    that one
    could write ColdFusion that runs on the ASP.NET framework and
    would then
    use the same memory locations with their server.
    Otherwise you are going to have to write your own sharing
    tool. Some
    code that can read the desired variables from one code base
    and pass it
    to the other code base through forms, web services or some
    other manner.

  • Which to use application.cfm or application.cfc?

    Hi,
    Just a general question, i have been using application.cfm
    for my applications so far. I came across a tag that would be used
    under application.cfc, but i tried putting both templates together
    in one application and boom, an error showed up.
    So, which is better to use with most of the applications
    application.cfm or .cfc?
    Thanks for any help!
    Syed

    It's actually a bit easier to use session and application
    scope variables with Application.cfc, I think.
    Application.cfc has methods for specific "events" or states:
    onApplicationStart() -- where to load application variables,
    security logic, etc.
    onSessionStart() -- initialize session varialbes, etc.
    onRequestStart() -- runs at the start of each page request
    onRequestEnd()
    onSessionEnd()
    onApplicationEnd()
    onError() -- very nice place to get some good
    Application-wide error handling code in place
    onRequest() -- be sure to read the notes on this
    method...it's a bit different.
    Check out the MX7 reference page for Application.cfc:
    http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?cont ext=ColdFusion_Documentation&file=00000692.htm
    CF* (if you're using that yet)
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Part_3_CFML_Ref_1.html

  • Convert Application.cfm

    I am working on a project that uses both Application.cfm and
    Application.cfc(CF6.1) and I think it is time to convert
    Application.cfm to Application.cfc, however I really don't know
    where to start from so please help.
    Application.cfm
    <cfprocessingdirective pageencoding="ISO-8859-15" />
    <meta http-equiv="description" content="Copyright Saragon
    1993 - 2000"></meta>
    <cfsetting enablecfoutputonly="YES">
    <cfsetting showdebugoutput="YES">
    <!--- OVERRIDE SERVER TEXT ENCODING TYPE --->
    <cfcontent type="text/html; charset=ISO-8859-1">
    <cfscript>
    setEncoding("form","iso-8859-1");
    setEncoding("url","iso-8859-1");
    </cfscript>
    <cfapplication name="ODYSSEYDEV_CUTS"
    sessionmanagement="YES"
    sessiontimeout="#CreateTimeSpan(0,0,20,0)#"
    applicationtimeout="#CreateTimeSpan(2,0,0,0)#"
    clientmanagement="NO"
    setclientcookies="YES">
    <!--- cause session vars to expire after the browser
    closes --->
    <cfif isDefined("Cookie.CFID") and
    isDefined("Cookie.CFTOKEN")>
    <cfset cfid_local = cookie.cfid>
    <cfset cftoken_local = cookie.cftoken>
    <cfcookie name="CFID" value="#cfid_local#">
    <cfcookie name="CFTOKEN" value="#cftoken_local#">
    </cfif>
    <cfset request.cv_directory = "cv_eps/src">
    <!--- get application wide settings -------------- --->
    <cfinvoke component="#request.cv_directory#.Application"
    method="getSettings"
    returnVariable="variables.settings">
    <cfscript>
    s_dbt = variables.settings.dbt;
    s_dsn = variables.settings.dsn;
    s_dsn2 = variables.settings.dsn2;
    s_dsn3 = variables.settings.dsn3;
    s_interfacedsn = variables.settings.interfacedsn;
    s_readdsn = variables.settings.readdsn;
    s_host_token = variables.settings.program_id;
    </cfscript>
    <!---
    TO CHANGE THE DNS CHANGE IT IN THE 'Application.cfc' PAGE
    WHICH IS IN THE SAME DIRECTORY AS 'Application.cfm'.
    CHANGES MADE TO THE CFC WILL UPDATE THE DSN FOR ALL THE
    SOFTWARE
    --->
    <cfset dbt = "#s_dbt#">
    <cfset dsn = "#s_dsn#">
    <cfset dsn2 = "#s_dsn2#">
    <cfset dsn3 = "#s_dsn3#">
    <cfset interfacedsn = "#s_interfacedsn#"><!---
    shared database user for insert/reading interface requests --->
    <cfset request.readdsn = "#s_readdsn#"><!---
    Datasource for READ codes --->
    <cfset back_ground_color = "##E8EBF0">
    <!--- <table bgcolor="#5C4D77" --->
    <cfset demo=false><!--- global switch between demo
    mode. --->
    <cfset debug=false> <!--- turn debugging statments
    on/off --->
    <cfset request.debug=false><!--- turn debugging
    statments on/off (GLOBAL - TO WORK IN TAGS) --->
    <cfset redirectUsers="tr_user"><!---
    nessex,diab_admin,shaw,admin,consultant,sara_admin,gp --->
    <cflock scope="SESSION" type="READONLY" timeout="10">
    <cfif isDefined("session.userid") AND
    (ListFind(redirectUsers,session.userid))>
    <cfset dsn = "cmedgar_at_coldman">
    <cfset dsn2 = "pmi">
    <cfset dsn3 = "pmi">
    <cfset dbt = "Oracle80">
    </cfif>
    </cflock>
    <!--- End database global variables --->
    <cfif NOT IsDefined("session.demoMode")> <!--- only
    set once --->
    <cfif IsDefined("session.userid")> <!--- only set
    if user has logged in --->
    <cflock scope="SESSION" type="READONLY" timeout="10">
    <cfset user_id = session.userid>
    </cflock>
    <cfif user_id NEQ "">
    <cfif NOT isDefined("demoUserList")>
    <!--- ** START OF DEMO MODE CODE ** --->
    <!--- add username names to this list for users wanting
    to use the demo mode --->
    <cfset demoUserList =
    "ifenton,samichie,agthorne,consultant,clerk"><!--- create
    list of users which will use the demo --->
    <cfif listFind(demoUserList,"#user_id#")><!--- if
    the user logged in is found in the list switch demo mode on --->
    <cflock scope="SESSION" type="EXCLUSIVE" timeout="10">
    <cfset session.demoMode = true>
    </cflock>
    <cfelse>
    <cflock scope="SESSION" type="EXCLUSIVE" timeout="10">
    <cfset session.demoMode = false>
    </cflock>
    </cfif>
    <!--- ** END OF DEMO MODE CODE ** --->
    <!--- ** START OF DEMO APPSMODE CODE ** --->
    <!--- add names to this list which will use the apps demo
    version --->
    <cfset appsDemoUserList =
    "ifenton,samichie,agthorne,consultant,clerk">
    <cfif listFind(appsDemoUserList,"#user_id#")>
    <cflock scope="SESSION" type="EXCLUSIVE" timeout="10">
    <cfset session.appsDemo = true>
    </cflock>
    <cfelse>
    <cflock scope="SESSION" type="EXCLUSIVE" timeout="10">
    <cfset session.appsDemo = false>
    </cflock>
    </cfif>
    <!--- ** END OF DEMO APPSMODE CODE ** --->
    </cfif>
    </cfif>
    </cfif>
    </cfif>
    <cflock scope="SESSION" type="READONLY" timeout="10">
    <cfif isDefined("session.appsDemo") AND
    session.appsDemo>
    <cfset del_file=false> <!--- turn delete file off
    if user in apps demo mode--->
    <cfelse>
    <cfset del_file=true> <!--- turn delete file on
    --->
    </cfif>
    </cflock>
    <!--- next if statment checks what OS platform CFusion
    server is running on a converts the paths accordingly --->
    <cflock scope="SERVER" timeout="10" type="READONLY">
    <cfif server.os.name IS "UNIX">
    <cfset app_path="">
    <cfset to_directory="/opt/ebiz/saragon/to/">
    <cfset from_directory="/opt/ebiz/saragon/from/">
    <cfset slash="/"> <!--- set the path separator '\'
    Win or '/' Unix --->
    <cfelse>
    <cfset slash="\"> <!--- set the path separator '\'
    Win or '/' Unix --->
    <cfset app_path="C:\"> <!--- Path to the TOPAS
    directory --->
    <cfset to_directory="opt\ebiz\saragon\to\"> <!---
    directory used for writing files to topas --->
    <cfset from_directory="opt\ebiz\saragon\from\">
    <!--- directory used for reading files from topas --->
    </cfif>
    </cflock>
    Application.cfc
    <cfcomponent displayname= "Application Settings" hint =
    "Stores all the settings for the application.">
    <cfprocessingdirective pageencoding="iso-8859-15" />
    <!--- set properties ------------------------------
    --->
    <cfscript>
    this.settings = StructNew();
    this.settings.dbt = "Oracle80";
    this.settings.dsn = "tayside10gcluster";
    this.settings.dsn2 = "NLG_PMI_at_coldman";
    this.settings.dsn3 = "NLG_PMI_at_coldman";
    this.settings.readdsn = "read_codes_at_testmx";
    this.settings.interfacedsn = "cmedgar_at_coldman";
    this.settings.program_id = "CF1";
    </cfscript>
    <cffunction name="getSettings" access="public"
    returntype="struct">
    <cfset st_return_value= this.settings>
    <cfreturn st_return_value>
    </cffunction>
    </cfcomponent>

    For a start, be aware of two things. First, use
    Application.cfc alone, never together with Application.cfm.
    Secondly, the code in Application.cfc must be lean. It must contain
    just the bare necessities.
    Read up on the
    purpose
    of each function in Application.cfc. I skimmed through your
    code and came up with the following.
    added edit: added application scope argument in
    onSessionEnd()

  • Trying to understand an application.cfm attack

    I have a site that I've been running without issue, for years now - I sniff and block for cross site scripting, sql injection, executable file uploads, and employ honeypot fields on forms... 
    This past week I wanted to watch some slow page loads for performance, noting their time to execute.  I chose to use an application.cfm and an onrequestend.cfm to set a timestamp and to place it on the end of my pages.  Prior to this, I have not utilzed an application.cfm.  I'm pragmattic and look upon the application.cfm as a catch-all to do things that I should be planning better for in my application.
    I soon found myself the recipient of a cross site scripting attack.  I realised easily that I opened myself wide to this because the application.cfm runs _before_ everything, including my sniffer code. Derrrr!
    I deleted the application.cfm and onrequestend.cfm and cleanded up my files having caught it same day and experiencing little damage.  The attack was only inserting javascript into my index pages via the application.cfm .  Rather ingenious and it was fun to find and consider.  Payday loan spam.
    I've been google'ing and reading on uploading vulnerabilities, but I can only find one instance where someone described their application.cfm file having been modified in similar fashion, the vector being a vulnerability in fckeditor - which I do not use. Nor do I use any other third party editor plugin.
    An article I found mentions vulnerable files in legacy CFDOCS folder that allow access and uploads.  I have a fresh install of CF9 so this did not exist.  There was a cfx folder tree with some "example" code folders.  I've zipped and deleted these.
    I have changed ftp to use a non-standard port.  Something that I used to do, but failed to re-instate when I moved to a different host.  I have a ticket submitted to get help in blocking CFIDE path requests to the outside world (so that it will only be accessable locally via RDP).
    If someone/something could modify the application.cfm file, why look for just it, unless it was just a lazy scripted attack looking for application.cfm files specifically.  And while I did not have one before, why did someone not just upload their own?
    How and why was my application.cfm changed, and why not the index.cfm files directly if they had some other avenue of access?
    My question is this - can the application.cfm be tricked into modifying itself?
    Thanks in advance!

    Sorry about that - a misunderstanding. When you said you "deleted the application.cfm and onrequestend.cfm and cleanded up my files...", I took that to mean you only deleted the code. I assumed the files to still be on the file system. For, to run a ColdFusion application of any substance, you do need an Application file.
    aotgnat wrote:
    The attack was only inserting javascript into my index pages via the application.cfm .
    Not necessarily via the application file. What the attacker may very likely have exploited is a ColdFusion Cross Site Scripting (XSS) vulnerability. This link shows you that a cfform, user-agent HTTP header, etc. may be used in an XSS attack. (See the XSS vulnerabilities relevant to CF9, which include CVE-2009-3467, CVE-2010-1293, CVE-2011-0583, CVE-2011-0733, CVE-2011-0734, CVE-2011-0735, CVE-2011-2463, CVE-2011-4368).

  • Verity search results return application.cfm

    We've got a couple of sites using verity collections to
    search cfml, html, and some mime documents. This is generally
    successful. However, we do see coldfusion script-only pages
    returning in the search results, including application.cfm, and
    other cfm pages that do not display content to the end-user. Since
    there is no HTML renderable content in these pages, why do they get
    included in the results?
    How can I control this behavior? I've looked at the verity
    documentation, and am trying to use the mkvdk utility to delete
    application.cfm from the collection documents, but am getting an
    error. If I can get the syntax down correctly, is this the proper
    way of addressing the problem?
    For instance, I am using the command string:
    mkvdk -delete -collection
    C:\CFusionMX\verity\collections\intranet\file application.cfm
    on my local development machine to try and test this, but get
    an error BadKeys: application.cfm
    I don't understand why these types of files get included in
    the collection in the first place. Oh, we are running CFMX6.1.
    Thanks for any help.
    Kris

    The issue is not how to remove all CFM files from the
    collection. We just want CFM files that do not output anything to
    the user to be excluded from the search index. Most of the files in
    this site are CFM files. Most importantly would be application.cfm,
    form action pages, and other included files.
    Certainly we could parse the results for a filename in a
    predefined list, but we are trying to avoid defining this
    programmatically; thinking that it is odd that these files get
    included in the results at all. In the past we have segmented sites
    using .cfm and .cfml as a way of excluding specific files from the
    index (in the collection definition, we would not include the
    specific extension as required). But this site has been in
    production for some time, and is just now adding a search feature.
    We don't want to rename files, and have to recheck every single
    page and link in the entire site.
    Does that explain what we're trying to do better?
    Cheers,
    Kris

  • Verity returning application.cfm

    We've got a couple of sites using verity collections to
    search cfml, html, and some mime documents. This is generally
    successful. However, we do see coldfusion script-only pages
    returning in the search results, including application.cfm, and
    other cfm pages that do not display content to the end-user. Since
    there is no HTML renderable content in these pages, why do they get
    included in the results?
    How can I control this behavior? I've looked at the verity
    documentation, and am trying to use the mkvdk utility to delete
    application.cfm from the collection documents, but am getting an
    error. If I can get the syntax down correctly, is this the proper
    way of addressing the problem?
    For instance, I am using the command string:
    mkvdk -delete -collection
    C:\CFusionMX\verity\collections\intranet\file application.cfm
    on my local development machine to try and test this, but get
    an error BadKeys: application.cfm
    I still think it's retarded that these types of files
    included in the collection in the first place. Oh, we are running
    CFMX6.1.
    Thanks for any help.
    Kris

    My first thought, because I have made this mistake several
    times is that the "A" in Application.cfm needs to be capital on
    *nix systems. I am not sure if that includes Macs.

  • Application.cfm /cflocation and redirection of changed link

    I have a link on my site http://www.mysite.com/ssl/oldpage.cfm that I have renamed to http://www.mysite.com/ssl/newpage.cfm.
    Many of my users have the old page bookmarked etc..................
    Is there a way to put code in the application.cfm that says if user trys to go to old page automatically redirect them to the new page?

    Not in the application CFC.
    But there is a great place to put code like that in most web server configurations.
    If not that, then the next level would be defining the "missing template handler" in the ColdFusion administrator.
    Finally, if you can't do either or those, keep the old file, but replace all of it's code with a <cfheader...> redirect (or a <cflocation...> permanent redirect if you are on a new version of ColdFusion.
    But, really, this is a web server level task and that is the best place to put this if you have contorl of yours.

  • Application.cfm in root and subdirectory, help.

    I cannot figure this out. I understand that an application
    will use the application.cfm file in it's current directory first
    and not search further. However, my page in a subdirectory seems to
    not see the application.cfm in it's own directory and instead uses
    the root application.cfm. Can anyone explain? And I have tried
    capitalizing the "A", etc. but I am not using Linux so I do not
    think it matters anyway. (CF MX)

    Hard to tell exactly, but in the subdirectory, is the ONLY
    line the <cfset application.dsn_test = "DiningHall">?
    If so, the subdirectory application.cfm would execute and the
    parent would not, which would cause the undefined error since from
    what I can tell, you haven't used the <cfapplication> tag in
    the subdirectory.
    What you can do is use a cfinclude in the subdirectory
    application.cfm.
    <cfinclude template="../application.cfm">
    <cfset application.dsn_test = "DiningHall">
    However.... That's a big no no if you're using this to
    actually change application scope parameters, since someone
    visiting the subdirectory would reset the DSN for someone that
    might still be navigating around in the parent directory.
    So what good is using the cfinclude method? Well, you can
    lock subdirectories to roles this way.
    <cfinclude template="../application.cfm">
    <cfif getAuthUser() eq "" or not IsUserInRole("Admin")>
    Access Denied!
    <cfabort>
    <cfif>
    Consider changing the DSN setting to use the request.scope to
    isolate the change to the user.
    <cfset Request.appDSN = "DININGHALL">

  • Symbolic Links do not work for Application.cfm in CF10

    I have a Web, that use a symbolic link for centralized code.
    The Application.cfm, stored in the original web-root, will not read from code
    in the linked directory.
    Thank you for your assistance.

    Adam,
    it seems to be a bug.
    The "Application.cfc/Application.cfm lookup order" in the ColdFusion Administrator seems not functional as expected. I did several tests and it happens not only at symbolic links. This happens on every subdirectory.
    Am I wrong, when I expect, that the "highest" Application.cfm found in a tree should be executed?
    Example:
    Application.cfm
    aaa.cfm
    "subdir1"                                 "subdir2"
    bbb.cfm                                   Application.cfm
                                                    ccc.cfm
    Settings in the ColdFusion Administrator
    Default order:
    - aaa.cfm: should execute the Application.cfm in root (/) only.
    - bbb.cfm: should execute the Application.cfm in root (/) only.
    - ccc.cfm: should execute the Application.cfm in subdir2 only.
    Until Webroot
    - aaa.cfm: should execute the Application.cfm in root (/) only.
    - bbb.cfm: should execute the Application.cfm in root (/) only.
    - ccc.cfm: should execute first the Application.cfm root (/) and then in subdir2
    In Webroot
    - aaa.cfm: should execute the Application.cfm in root (/) only.
    - bbb.cfm: should execute the Application.cfm in root (/) only.
    - ccc.cfm: should execute the Application.cfm in root (/) only.
    Am I wrong with this?
    In my case, only "In Webroot" work as expected.
    Torsten

  • Turning off application.cfm

    Hello,
    not sure about this but is there a tag or method whereby I
    can overwrite the CF servers automatic inclusion of an
    application.cfm (.cfc). I have one page in a sub-subfolder of a
    website where the application.cfm is in the top (parent) folder. I
    am having problems including this page in a programme and am
    looking at any possible causes for this.
    One thought was that some methods in my application.cfm may
    be causing the error. Without removing or altering the
    application.cfm in anyway... is it possible to just deactivate it
    on certain pages?
    Thanks

    > not sure about this but is there a tag or method whereby
    I can overwrite the
    > CF servers automatic inclusion of an application.cfm
    (.cfc).
    No. There is not.
    > I have one page in
    > a sub-subfolder of a website where the application.cfm
    is in the top (parent)
    > folder.
    To bypass this grandparent Application.cfm, you simply have
    to a "nearer"
    Application.cfm which is empty. But...
    > I am having problems including this page
    ... Only the initial template referenced in a request
    triggers the process
    that seeks an Application.cfm. If you're simply including the
    file,
    Application.cfm plays no part in it (beyond what I already
    said).
    > One thought was that some methods in my application.cfm
    There's no such thing as "methods" in an Application.cfm. Do
    you mean
    UDFs? Without you actually posting your error, it's a bit
    hard to guess
    WTF you're on about, to be honest.
    > is it
    > possible to just deactivate it on certain pages?
    No.
    Adam

  • Application.cfm

    Does ColdFusion need application.cfm to store the application parameter?
    Is application.cfm is required in the ColdFusion application?
    Your information and help is great appreciated,
    Regards,
    Iccsi,

    No.  Application.cfm is very badly named: it should be OnRequestStart.cfm.  It doesn't - intrinsically - have anything to do with applications in the ColdFusion sense of that notion.
    What you do need, however, is a <cfapplication> tag that gets run on every request, to bind the request to an application (and, by proxy, to a session).  The best place to put something that needs to be run every request is in Application.cfm.
    That said, you ought to be using Application.cfc for this sort of thing, not Application.cfm.  Application.cfm is - for all intents and purposes - obsolete.  It still works, but it is grossly inferior to Application.cfc.  And there is no reason to be using it in favour of going with the recommended Application.cfc route.
    Adam

  • Why does application.cfm file not get processed first?

    I am using ColdFusion 11 on Windows2008 R2. From what I understand, if there is an application.cfm page in the root folder, that any .cfm page below the root will process this page first and then process the regular .cfm page. I noticed that it processes my regular page FIRST and then calls the application.cfm page.
    In my case I have a web page that updates a database, but in my application.cfm page, I check a session variable to see if the user is logged in. If they are not logged in, then I redirect them to a log in page, let them log in, set the session variable and then redirect them back to process the page. But I noticed, that when I run the page, the database gets updated and THEN the user gets redirected to log in, then the database gets updated again.
    Am I not using the application.cfm page correctly? I thought it was supposed to be used to check log ins and things like that. How do I ensure that it runs first?
    Btw, it is the only application.cfm page in the entire web site and I do not have any application.cfc files.
    Thanks.

    It would make things easier to see the code. In any case, from what you say, my guess is that there is no authentication check at the point where the database gets updated. So the update occurs at the start, and again when you later redirect the user to the page.
    On Coldfusion 11, you should actually switch to Application.cfc. There are at least 2 reasons.
    Firstly, recent Coldfusion versions implicitly assume you use Application.cfc by default. Secondly, Application.cfm is outdated and has much less functionality than Application.cfc. For example, Application.cfc allows you much more fine-grained control over your code at the level of request, session and application.

  • Protecting Application.cfm

    What security measures can we take to protect the
    Application.cfm file. We usually keep database login and password
    info obviously and other password info. Is there really nothing
    else to do except knowing that no one should access the actual
    file? thanks!

    quote:
    Originally posted by:
    Dan Bracuk
    Why do you have database login information and other
    passwords there?
    Well, the login and password must be in the <cfquery>
    tag on any given page that queries the db. We just put it in a
    application variable instead of on every single database driven
    page.
    We do the same for <cfmail> you need to put the email
    and the password in the tag so we use application variables instead
    to make changes more efficient.
    When you try accessing application.cfm from the browser you
    get:
    nvalid request of Application.cfm, Application.cfc or
    OnRequestEnd.cfm file.
    You have requested a page with the name application.cfm. This
    file name is reserved by the ColdFusion engine for the
    specification of application level settings and therefore cannot be
    directly requested from a web client.

Maybe you are looking for