I have an issue where if I don't use the ColdBox application for a while, it seems to forget the routing. Here is the redirect code in the handler:
<cfset event.setValue("fromLogin", true) />
<cfset setNextEvent(event=redirectPage, persist="fromLogin") />
The problem I had was that the page is https: but the setNextEvent drops the https:
I fixed this in Routes.cfm, which looks like this:
<cfscript>
// Allow unique URL or combination of URLs, we recommend both enabled
setUniqueURLS(false);
// Auto reload configuration, true in dev makes sense to reload the routes on every request
//setAutoReload(false);
// Sets automatic route extension detection and places the extension in the rc.format variable
// setExtensionDetection(true);
// The valid extensions this interceptor will detect
// setValidExtensions('xml,json,jsont,rss,html,htm');
// If enabled, the interceptor will throw a 406 exception that an invalid format was detected or just ignore it
// setThrowOnInvalidExtension(true);
// Base URL
if( cgi.HTTPS is "off" ){
protocol = "http";
}
else{
protocol = "https";
}
if( len(getSetting('AppMapping') ) lte 1){
setBaseURL("#protocol#://#cgi.HTTP_HOST#/index.cfm");
}
else{
setBaseURL("#protocol#://#cgi.HTTP_HOST#/#getSetting('AppMapping')#/index.cfm");
}
// Your Application Routes
addRoute(pattern=":handler/:action?");
</cfscript>
but as I said, if I leave the application for a while and come back to it, this no longer works and the https gets lost again. I have to do a fwreinit=1 to get it back.
Any ideas? Or any hints about forcing a fwreinit=1 when it's needed?
-Don