Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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