February 26th, 2004, 03:04 PM
For The Most Experts Of You
Here is the challenge.
I want to examine all the sessions, to find if a SESSION.UserID variable does contain a certain value to know if a user is logged-in already or not.
Is this possible ?
Thanks in advance to you all.
February 26th, 2004, 04:05 PM
As far as I know, the only way to do something like this is to call the underlying Java objects that manage sessions for CFMX. This would be a hack and would also be unsupported, with the possibility that a future version of CF would completely break it. With those caveats, you should be able to do something like this to get all active sessions for a specific application (as defined in the <cfapplication> tag):
<cfset st = createObject("java", "coldfusion.runtime.SessionTracker")>
<cfset sessions = st.getSessionCollection(appname)>
Again though, this is a total hack, so use at your own risk!