Hi,
Is there an onSessionStart event handler?
I want to do some processing when a new session is started. Where would I put this.
Thank you.
Hi,
Is there an onSessionStart event handler?
I want to do some processing when a new session is started. Where would I put this.
Thank you.
Hi AJ,
Since I did not count on using Application.cfc and its methods, but
the external include. ColdBox does not provide this out of the box.
However, you can still do this, but I do not have the perfect solution
for it yet. I have been planning to add this to 2.1.0 where you can
either choose to include the framework via the index.cfm or via the
Application.cfc.
I can give you some ideas for now, but not a standard solution until I
get this ported to run EXCLUSIVELY on the Application.cfc
in the onSessionStart method of the Application.cfc, you can set the
url.event or form.event variable to the event you wish to fire at the
beginning of the session. That is it. Then the framework will get
the request and process it with a set event variable. In your
onSessionStart handler, you can then relocate or revert to the
original default event.
I have actually tested this and will be adding it to the docs as
alternatives for now.
Luis
Thanks Luis.
How would you go about storing the original request?
May be as simple as a URL
or more complex if it is a form post.
I do recall see something like next request - would you use that?
Then everything would still be in the EVENT scope.
I think it would be good if the framework had hooks for start and end session like it does for request and application.
I agree totally AJ. I created a ticket for this for 2.1.0.
As of now, we are both on testing territory for this.
What I would do is just set the incoming event into the form as “old_event” like:
form.old_event = form.event
form.event = “ehGeneral.onSessionStart”
Then when the onSessionStart event executes, you will have all the state variables. I would do my processing and then setNextEvent to the sent event.
Luis