Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Extending Application.cfc in sub folders

New Here ,
Jun 23, 2009 Jun 23, 2009

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.

TOPICS
Advanced techniques
936
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 23, 2009 Jun 23, 2009

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

/dir1/Application.cfc.

Mack

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 24, 2009 Jun 24, 2009

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.

Regards

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 24, 2009 Jun 24, 2009
LATEST

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.

Mack

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources