[coldbox-3.5.2] Sharing Session Across Multiple Applications

Hi all,

Can some body help me with the best way to do this, I’m having no end of problems getting it running and after a week of trying to get it to work I may have to abandon CB, which I don’t want to do as the bits I can get to work are great.

I know this kind of follows on from my previous post about solitary, but I think it’s a separate issue.

I have multiple IIS sites on the same server each with their own sub domain and I need to share the session between them to do single sign on across the sites, so for example:

profile.example.com
forums.example.com

Each site has a copy of the ColdBox framework in its web root in a folder called coldbox.

profile.example.com – application.cfc has

<cfset this.name = " exampleApps">



profile.example.com – coldbox.cfc has

appName = " exampleProfile ",

forums.example.com – application.cfc has

<cfset this.name = “exampleApps”>



forums.example.com – coldbox.cfc has

appName = " exampleForums",

I’m then setting a domain cookie in both application.cfc’s in onRequestStart in order to share the J2EE session across the sites

Also I have run into issues with the wirebox instance in the application scope. Would I need to set the key differently for each application.

scopeRegistration = {
enabled = true,
scope = “application”, // server, cluster, session, application
key = “wireBox”
},

Obviously I’m not doing something right, and any help would be greatly appreciated.

Kind regards,

Richard

Hey Richard,

Can you explain what sort of problems you’re running into?

From your explanations, and from what you have shown, it looks like you have isolated each instance of ColdBox correctly.

Hi Andrew,

Thanks for your reply. My current error is

Application Execution Exception
Error Type: Application : [N/A]
Error Messages: Error while executing the Hibernate query.
org.hibernate.HibernateException: coldfusion.runtime.CustomException: ColdBox Controller Not Found
Tag Context:
ID: CF_CFPAGE
LINE: 230
Template: E:\profile.example.com\coldbox\system\orm\hibernate\BaseORMService.cfc
ID: CF_TEMPLATEPROXY
LINE: 82
Template: E:\profile.example.com\model\security\SecurityService.cfc
ID: CF_TEMPLATEPROXY
LINE: 74
Template: E:\profile.example.com\handlers\Security.cfc
ID: CFINVOKE
LINE: 739
Template: E:\profile.example.com\coldbox\system\web\Controller.cfc
ID: CF_UDFMETHOD
LINE: 623
Template: E:\profile.example.com\coldbox\system\web\Controller.cfc
ID: CF_TEMPLATEPROXY
LINE: 236
Template: E:\profile.example.com\coldbox\system\Coldbox.cfc
ID: CF_UDFMETHOD
LINE: 58
Template: E:\profile.example.com\Application.cfc
ID: CFTHROW
LINE: 164
Template: E:\profile.example.com\coldbox\system\core\util\Util.cfc
ID: CF_TEMPLATEPROXY
LINE: 195
Template: E:\profile.example.com\coldbox\system\remote\ColdboxProxy.cfc
ID: CF_UDFMETHOD
LINE: 205
Template: E:\profile.example.com\coldbox\system\remote\ColdboxProxy.cfc
ID: CF_UDFMETHOD
LINE: 133
Template: E:\profile.example.com\coldbox\system\remote\ColdboxProxy.cfc
ID: CF_UDFMETHOD
LINE: 34
Template: E:\profile.example.com\coldbox\system\orm\hibernate\EventHandler.cfc

Which is when I try to process the login. What I don’t understand is this was working perfectly yesterday. Today, nothing :frowning:

Thanks,

Richard

What version of ColdBox are you using? When I look at the line 230 in BaseORMService, all I see is a ColdFusion ORMExecuteQuery.

Just out of curiosity, have you made sure you have disabled the caching of component paths? This has caused issues with ColdBox across multi-sites.

CB 3.5.2. Yeah the line in the SecuritySerice.cfc that calls it is just

var user = userService.findIt(“from User u where u.emailPasswordHash = :uph OR u.usernamePasswordHash = :uph”, {uph=userPassHash});

I hadn’t disabled the caching of component paths in the CF Admin. I have now though and still get the same error. Is there anywhere in Coldbox I need to disable caching of component paths?

Thanks,

Richard

As far as I can recall, that is the only thing you need. But you may need to clear that cache in the Admin.

Yeah I cleared it at the same time as disabling it. I know it says it doesn’t need a restart but I did it any way and still get the same error. It just seems like I’m banging my head against a wall.