The problem I'm running into is that the this scope variables are not
cascading down into the subclasses. This means that if I try to reference
Session.Whatever inside /sub/application.cfc, I get an error stating that
session variables aren't enabled. The only way I can get this to work is by
including the this.??? declarations in each and every Application.cfc.
The requested scope session has not been enabled.
Before session variables can be used, the session state management system
must be enabled using the CFAPPLICATION tag.
The error occurred in C:\CFusionMX7\wwwroot\members\Application.cfc
Try this for me Sean, and let me know if you have the same problem...
/members/Application.cfc:
<cfcomponent extends="ApplicationProxy">
<cffunction name="OnRequest">
<!--- Check to see if a user is logged in --->
<cfif NOT Session.LoggedIn>
...
</cfif>
</cffunction>
</cfcomponent>
/ApplicationProxy.cfc
<cfcomponent extends="Application">
</cfcomponent>
/Application.cfc
<cfcomponent>
<cfscript>
this.name = "MyApp";
this.sessionmanagement = "True";
this.sessiontimeout = CreateTimeSpan(0,0,20,0);
</cfscript>
<cffunction name="OnSessionStart" output="false">
<cfset Session.LoggedIn = False />
</cffunction>
<cffunction name="OnRequestStart" output="false">
...
</cffunction>
</cfcomponent>
Browse to a file in the members folder and see what happens...
Dan
> In your root directory, add a CFC called ApplicationProxy.cfc that
> extends Application:
>
> <cfcomponent extends="Application">
> </cfcomponent>
>
> Then in your subdirectory Application.cfc can extend ApplicationProxy:
>
> <cfcomponent extends="ApplicationProxy">
> ... overriding stuff here ...
> </cfcomponent>
>
> That should avoid the name conflict and still work properly
> (untested!).
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]