I am trying to figure out how to manage the session for a flex client which is connecting to lcds/coldfusion instance. I have determined the "logic" behind the problem, but can't figure out how to implement using CF8.
I'd like to be able to track login/logout (browser close) via FlexSessionListener. Here's the Java class I found to handle the events: ----------------------- import flex.messaging.*; public class SessionWatcher implements FlexSessionListener { protected FlexSession session; public SessionWatcher() { FlexSession.addSessionCreatedListener(this); } @Override public void sessionCreated(FlexSession session) { this.session = session; System.out.println("Session " + session.getId() + " has been created"); session.addSessionDestroyedListener(this); } @Override public void sessionDestroyed(FlexSession session) { System.out.println("Session " + session.getId() + " has been destroyed"); } } -------------------------------- I've compiled this and placed it into the WEB_INF/classes directory, and have successfully called it via CreateObject("java", "SessionWatcher"). However, this is as far as I've gotten. I simply don't understand the method in which I can "merge" this with my existing CFC file which is called on client login to implement this. Here's what I've tried: --------------------------------- listenerClass1 = CreateObject("java", "SessionWatcher"); CreateObject('java', 'flex.messaging.FlexContext').getFlexSession().addSessionCreatedListener(listenerClass1); CreateObject('java', 'flex.messaging.FlexContext').getFlexSession().addSessionDestroyedListener(listenerClass1); -------------------------------- I'm either not finding the "System.out.println" output from the listener functions when they are callled, or they're not getting called at all. If somebody has done this before, then please give me some idea on how to accomplish this. However, if anybody can even point me in the right direction for how you use Java files in CF that would be a help as well. Thanks in advance, Brendan