#1
  1. No Profile Picture
    mr.
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    Italy
    Posts
    2
    Rep Power
    0

    Question For The Most Experts Of You


    Hello.

    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.

    GubaGuba
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,243
    Rep Power
    967
    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!

IMN logo majestic logo threadwatch logo seochat tools logo