I am attempting to disable coldfusion’s session and client management for a coldbox application.
I updated my Application.cfc with
`
this.clientManagement = false;
this.sessionManagement = false;
this.setClientCookies = false;
`
And I updated my coldbox/config.cfc like so
`
flash = {
scope = “cache”
};
`
However, when I actually run the app I get the following error
# 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 G:/apps/lib/Coldbox/5.0.0-rc.1/system/web/flash/ColdboxCacheFlash.cfc: line 45 |
The function that is erring looks like
`
function getFlashKey(){
var prefix = “cbFlash:#application.applicationname#”;
// this is if is the line that barfs
// specifically, it breaks on the structkeyexists call
// session is defined but it errors if you access it
// Check jsession id First
if( isDefined( “session” ) and structKeyExists( session, “sessionid” ) ){
return “cbFlash:” & session.sessionid;
}
// Check normal cfid and cftoken in cookie
else if( structKeyExists( cookie, “CFID” ) AND structKeyExists( cookie,“CFTOKEN” ) ){
return prefix & hash( cookie.cfid & cookie.cftoken );
}
// Check normal cfid and cftoken in URL
else if( structKeyExists( URL, “CFID” ) AND structKeyExists( URL,“CFTOKEN” ) ){
return prefix & hash( URL.cfid & URL.cftoken );
}
// check session URL Token
else if( isDefined( “session” ) and structKeyExists( session, “URLToken” ) ){
return prefix & session.URLToken;
} else {
throw(
message = “Cannot find a jsessionid, URLToken or cfid/cftoken in the cookie scope. Please verify”,
type = “ColdboxCacheFlash.CFIDException”
);
}
}
`
I know very little (nothing) about how the flash scope works in coldbox but looking at this code I’m not sure how it would work if you have session/client management disabled and have set coldbox to use the cache for flash persistence.
Can someone help me understand what I’m missing? Does this mean that Coldbox depends on session/client management being enabled?