3 Replies Latest reply on Jun 24, 2009 3:08 AM by mack_

    Extending Application.cfc in sub folders


      I am enabling SessionManagement in root Application.cfc. I am trying to extend Application.cfc in subdirectory but I get sessionManagement as "No". I want to use the base session variables throughout the application. Basically sessionManagement is not enabled for the sub folders. Please find attached the sample app code for this. I am working in Coldfusion 8 Windows Platform.

        • 1. Re: Extending Application.cfc in sub folders
          mack_ Level 3

          When extending Application.cfc the parent initialization code is not

          executed and therefore the this.(name|sessionManagement) variables are

          not set (sessionManagement defaults to false).


          But there's no need to have Application.cfc in each directory because

          ColdFusion searches for Application.cfc first in the directory of the

          requested file and if it doesn't find one it continues searching for

          Application.cfc up the parent directories until it reaches the drive

          root. For example if you have /Application.cfc the session variables

          are available in /dir1/file.cfm without the need for an additional




          • 2. Re: Extending Application.cfc in sub folders
            NDaftary Level 1

            Hi Mack


            I need to switch over from Application.cfm to Application.cfc in my application. Currently, it has Application.cfm in subdirectories which contains initialization code (e.g DOC_ROOT ) to be used by files in subdirectories. I need to set those in Application.cfc now. I need to know how to extend the application/session/request variables in subdirectory.



            • 3. Re: Extending Application.cfc in sub folders
              mack_ Level 3

              I would move the DOC_ROOT type variables to the root Application.cfc

              (and make it an absolute variable if it's currently absolute). I don't

              see a different solution using Application.cfc at this point.