RE: [coldbox:15474] [coldbox-3.5.1] Injection Happy

property name=“founduser” inject=“id:currentUser”;

That code will create a variable called “variables.founduser” in your interceptor which will be a reference to the session variable that you have mapped to that id. There is no issue doing it that way AS LONG AS your interceptor is not a singleton. i.e. singleton=true or cache=true cacheTimeout=0 in the interceptor’s component declaration.

Changes made to the variable in your interceptor should be visible outside the interceptor since you are just injecting a reference to the session-scoped object. Perhaps you can dump out your session scope and abort in the interceptor after touching the founduser object to confirm if the object you’re interacting with is actually the one stored in session. There is always a possibility that your object is not getting scoped correctly and is actually a “no scope” or transient object on accident.

Also, this is a little off today’s topic but you posted this code the other day which is a little off and I never got a chance to reply to it.

mapPath() is a shortcut for map().to(), so it is redundant to use mapPath().to().
The difference is map().to() allows you to name the mapping whatever you want. mapPath() assumes that the mapping will be named the same as the CFC.
Also, mapPath() is supposed to take a full component pah relative to your scan location, so unless you have a CFC called “systemcgi” in the root of your scan location, that config line probably wasn’t even working.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform: