<cfset tracker = createObject("java", "coldfusion.runtime.SessionTracker")>
<cfset sessions = tracker.getSessionCollection("appname")>
<cfloop collection="#sessions#" item="key">
<cfoutput>#sessions["#key#"].emplid#</cfoutput>
</cfloop>
each session is stored in the sessions struct....looking at the above code.
so loop through this struct and hit the data in each session. Assuming that you set session.emplid for each users session, the above should list the emplids for the current sessions for appname. You can get to whatever other data this way too.
HTH
Doug
-----Original Message-----
From: Eric Creese [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 3:18 PM
To: CF-Talk
Subject: RE: How to count sessions
How can you get the info from the session var? I get a number as well as a time stamp like the following when I use that code to loop through the list. I set the session id for their user based on their userid. It is the user id I want to use to query to get the user information. So When I output this I can say 3 users are logged in and the users are. .
Total Active Sessions : 3
90873 - {ts '2003-11-10 14:01:38'}
90874 - {ts '2003-11-10 14:06:05'}
90872 - {ts '2003-11-10 13:59:33'}
-----Original Message-----
From: DURETTE, STEVEN J (AIT) [mailto:[EMAIL PROTECTED]
Sent: Friday, November 07, 2003 4:40 PM
To: CF-Talk
Subject: RE: How to count sessions
Eric,
Assuming that Application.UsersInfo is a structure...
<cfoutput>
<cfloop list="#structKeyList(Application.UsersInfo, ',')#" index="myLoop">
#myLoop# - #Application.UsersInfo[myLoop]#<br />
</cfloop>
</cfoutput>
Steve
-----Original Message-----
From: Eric Creese [mailto:[EMAIL PROTECTED]
Sent: Friday, November 07, 2003 5:25 PM
To: CF-Talk
Subject: RE: How to count sessions
How can I convert #StructCount(Application.UsersInfo)# into something that
will make the Application.UsersInfo a simple value that I can then use for
querying?
-----Original Message-----
From: Eric Creese
Sent: Friday, November 07, 2003 4:13 PM
To: CF-Talk
Subject: RE: How to count sessions
ok I did the tutorial and got what I wanted. Now here is a tough one. can I
use the the session vars to to query my users table to display the users
names?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, November 07, 2003 3:55 PM
To: CF-Talk
Subject: RE: How to count sessions
http://tutorial12.easycfm.com/ <http://tutorial12.easycfm.com/>
copy & paste is your friend ;)
put it in the Application.cfm page
> where should I put this code?
>
> -----Original Message-----
> From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 07, 2003 3:18 PM
> To: CF-Talk
> Subject: RE: How to count sessions
>
>
> wonderful... nice trick - very helpful.
>
> -Mark
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 07, 2003 2:58 PM
> To: CF-Talk
> Subject: RE: How to count sessions
>
> actually there is...one way in CFMX is this quick stuff
>
> <cfapplication name="sessionLister" sessionManagement="yes">
>
> <cfset tracker = createObject("java",
> "coldfusion.runtime.SessionTracker")> <cfset sessions =
> tracker.getSessionCollection("myappname")>
>
> <cfdump var="#sessions#">
>
> Ray Camden has some other code for this...a flash app even...out on
> his blog under
> http://www.camdenfamily.com/morpheus/blog/
<http://www.camdenfamily.com/morpheus/blog/>
>
> Doug
>
> -----Original Message-----
> From: brob [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 07, 2003 3:56 PM
> To: CF-Talk
> Subject: Re: How to count sessions
>
> I dont think there's a server variable that counts the number of
> unique sessions available. You can find out this way
> though....First yo have an application variable like
> application.counter, and then everytime a member logs in you increment
> that counter by 1.
>
> Be sure to check for things like if they are already logged in and are
> just signing in again, to not increment the
> counter. You can also avoid this problem by writing code on the login
> page to forward them to their member page if their logging session
> variable is TRUE. That way they dont have to put in their
> username/password twice
> ----- Original Message -----
> From: Eric Creese
> To: CF-Talk
> Sent: Friday, November 07, 2003 2:22 PM
> Subject: How to count sessions
>
> How can you count the number of active session are opened. For
> instance I have a membership site and I want to get a
> count of members who have logged in and have an open session.
>
> E
>
> _____
>
>
> _____
>
>
>
_____
_____
_____
_____
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

