I am writing my first custom interceptor today handle Active Directory Authentication. When the session starts I want to setup 2 variables.
public void function sessionStart(){
sessionStorage.setVar(‘isLoggedIn’,false);
sessionStorage.setVar(‘username’,getAuthUser());
}
Now that works fine but is there anyway to manually call sessionStart during development? The way I found to do it is by creating a a onSessionStart() method in my Main handler and announcing the event. Is this a good way to do this?
public void function onSessionStart(event){
announceInterception(“sessionStart”);
}
and then i have to fire off an onSessionStart() in the onRequest to get that to run…
So this is what I don’t get… I shouldn’t need to announce this at all. If you look at the onSessionStart method in coldbox.system.ColdBox this interceptor is already announced for us.
You should only need to announce it if your testing your code without really starting a new session.
Are you saying, when you “really” start a new session (using a new browser, or deleting cookies) your interception point is firing as expected, or, not?