onSessionEnd

I am using ColdBox 3.0.0 RC1-318-GENESIS-14:14 on Linux & Windows
running Adobe CF 9.0.1.

I have Coldbox.cfc setup as the following snippet:

      sessionStartHandler = "General.sessionStart",
      sessionEndHandler = "General.sessionEnd",

General.sessionStart fires correctly but General.sessionEnd does not
fire. I have "per app configs" enabled in CFIDE and SessionTimeout
set to 2 minutes.

Any suggestions on how to get onSessionEnd to fire?

Are you using the regular or non-inheritance Application.cfc?

What code isn't running on the sessionEnd? You do realize that any output in your onSessionEnd won't be output to the screen, since it happens automatically on the server separate from any request processed via IIS or Apache, right? (just checking)
Also, I assume your application timeout is longer than your session timeout? The onSessionEnd handler only runs if ColdBox still exists.

You could try putting a cfmail or something directly in the Application.cfc's onSessionEnd method to confirm whether ColdFusion is firing it and if the framework and sessionEndHandler setting is being found. If your application.cfc is extending coldbox.cfc, you'll find the method in there. It could be than an error is happening and you just can't see it. Check the coldbox logs, or wrap it in a try catch and E-mail yourself if it errors for debugging purposes.

Thanks!

~Brad

Session timeout is 5 minutes, application timeout is 2 hours, I’m using regular Application.cfc but I modified the session timeout to be 5 minutes.

Actually, I am trying to send an email on timeout to test it. I’ve checked all server logs and undeliverable mail folders/logs.

Any other ideas?


Jeremy R. DeYoung
Phone: 615.261.8201

FacebookLinkedInGoogle ReaderTwitterAmazonGoogle
Google Talk/LunarFly Skype/DeYoungJD

You could try using the cflog to write a log file yourself to see if it is firing and the email is ending up in a spam folder somewhere.

Regards,

Andrew Scott

http://www.andyscott.id.au/

~WRD000.jpg

tried cflog. i removed everything except cflog and onSessionStart fires correctly but onSessionEnd does not.

The only thing I could get to work is the onSessionEnd if I actually manually add cflog to the Application.cfc in the root.

I’ve tested on both windows & linux using Adobe 9.0.1. Still nothing. Any other ideas?


Jeremy R. DeYoung
Phone: 615.261.8201

FacebookLinkedInGoogle ReaderTwitterAmazonGoogle
Google Talk/LunarFly Skype/DeYoungJD

The only thing I could get to work is the onSessionEnd if I actually manually add cflog to the Application.cfc in the root.

You mean you added it to the onSessionEnd method in coldBox.cfc (which your application.cfc extends) or added an onSessionEnd method in the actual application.cfc file. If you did the latter, then that is overriding the onSessionEnd method in coldbox.cfc and your onSessionEndHandler wouldn’t get called.
I can’t quite tell exactly what you’re doing from what you’ve said. There’s a really good change your session end handler is erroring. I would make sure you have no onSessionEnd in your application.cfc and wrap a try/catch around the onSessionEnd in coldbox.cfc with a log in the cfcatch that tells you the cfcatch.message and see if that gets hit.

Thanks!

~Brad

I might be off base here, but my understanding (haven't used it) is
that you need to configure a SessionEndHandler in your coldbox config
for the app, then that method should fire at the end of each session.
It's not intended that you override the ColdFusion-level onSessionEnd
handler, either in the core ColdBox.cfc or your app's Application.cfc.

Make sense?

Dave

Dave,

It is setup in my Coldbox.cfc however its not firing :frowning: thus the problem. Know that the SessionStartHandler works perfectly, the SessionEndHandler does not fire. Is it possible that Coldbox could have some type of bug with SessionEndHandler?

The ONLY thing I have in my SessionStart & SessionEnd Handlers is or

Nothing else.


Jeremy R. DeYoung
Phone: 615.261.8201

FacebookLinkedInGoogle ReaderTwitterAmazonGoogle
Google Talk/LunarFly Skype/DeYoungJD

Apologies for the drive-by, should have gone back further in earlier msgs.

Dave