One other thing I forgot to mention in my previous mail is that once it
finds the first application.cfm file during the search from the current
directory upwards, it stops.  It does not search upwards for any more
application.cfm files.

So, if you have an application.cfm file in your root, and another
application.cfm in a subdirectory of /control, and you open any template in
the /control directory, it will pre-pend the application.cfm file from the
/control directory and nothing else.

        dBIII+

-----Original Message-----
From: Gary McNeel, Jr. [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 25, 2000 4:42 PM
To: Cf-Talk
Subject: Application.cfm Question...


Are application.(variablename) variables truly persistent. I am a bit
confused here. I know that only one application.cfm file is executed
automatically at any given time (others would have to be CFINCLUDEd).

I have a main application.cfm file in the root of the site. I set the
cfapplication (application and session management, name, etc.). I then set a
few application variables like application.dsn and application.sitename,
etc. That's about it.

(ex: main root application.cfm)

<cfapplication name="BugTracking"
        setclientcookies="Yes"
        sessionmanagement="Yes"
        sessiontimeout="#CreateTimeSpan(0,0,20,0)#"
        applicationtimeout="#CreateTimeSpan(2,0,0,0)#">

<cflock timeout="30" throwontimeout="Yes" type="EXCLUSIVE"
name="#Application.ApplicationName#">
        <cfset application.dsn = "BugTracking"> <!--- Sets the datasource to
use --->
        <cfset application.sitename = "Item Tracking">
</cflock>


A directory level down I add another application.cfm that does a very quick
security check for user access to this area (yes/no field in db). In the
CFQUERY I use a datasourcename="#application.dsn#". I have, in the past,
just copied the application.cfm from the root into the other folder and
deleted anything not necessary, leaving the cfapplication and application
variables, then adding any other code.

<ex: sub directory application.cfm>

<cfif isdefined("cookie.PeopleID")>
        <cfquery datasource="#application.dsn#" name="qryAuthen">
                SELECT PeopleID, PeopleFirstName, PeopleLastName, PeopleDACStaff
                FROM tblPeople
                WHERE PeopleID = #cookie.PeopleID#
        </cfquery>
<cfelse>
        <cflocation addtoken="No" url="../mainMenu.cfm">
        <cfabort>
</cfif>


Today I went ahead and deleted everything EXCEPT the little security query
(above) to see what would happen. Now the application can't seem to find my
application.dsn variable.

Does the running of another application.cfm file flush the variables created
previously?

Shouldn't the application variables be available for the life of the
application AS LONG as they are not flushed (STRUCTCLEARED or DELETED) or
changed?

Why would running another application.cfm, that does not delete or change
the earlier set application variables, make them unavailable to the
application?

Do you have to re-create the application.cfm file for each subfolder?

TIA

Gary McNeel, Jr.
Project Manager - DAC-Net, Research & Graduate Studies
Rice University - Houston
[Lovett Hall] 713-348-6266 (Primary)
[DAC] 713-348-5184
[M] 713-962-0885
[H] 713-723-9240

"Great spirits have always encountered violent opposition from mediocre
minds."
   -Albert Einstein

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to