This is my first attempt at subsystems and for the most part things are going well. I’m having trouble redirecting usesr from a subsystem site to the main top site when the session ends.
Here may site structure, it pretty standard.
- I’ve logged in from the mainSite
- Base on my login I get redirected to the appropriate subsystem i.e. (subSite1, subSite2)
- When my session ends I want to be redirect to mainSite.login, instead it’s redirecting me to subSite1.login.
My question is, how do I redirect user from the subsystem sites to the mainSite login?
Here is my site structure.
mainSite
-assets
-contorllers
-login.cfc
-security.cfc
-framework
-layouts
-model
-subsystems
-subSite1
-controllers
-layouts
-model
-views
-main
-default.cfm
application.cfc
index.cfm
-subSite2
...
-views
-login
-default.cfm (login form)
application.cfc
index.cfm
The /mainSite/controllers/security.cfm is straight from the FW/1 download with minor changes for my needs. I've tried updating the redirect in authorize() function but have not had luck. Thank you in advance for your insights.
component {
function init( fw ) {
variables.fw = fw;
}
function session( rc ) {
// set up the user's session
session.auth = {};
session.auth.isLoggedIn = false;
session.auth.fullname = 'Guest';
}
function authorize( rc ) {
// check to make sure the user is logged on
if (not(structKeyExists(session, "auth") && session.auth.isLoggedIn ) && !listfindnocase('login', variables.fw.getSection() ) && !listfindnocase('main.error', variables.fw.getFullyQualifiedAction() )) {
variables.fw.redirect('login');
}
}
}