Here you go Joel, I got this code from someone else long ago, and now am
passing it on to you. =) You may store other data about them, but you
can go from here.
<cfapplication name="yourApplicationName">
<cfscript>
sessiontrackerObj=
createObject("java","coldfusion.runtime.SessionTracker");
activesessions =
sessiontrackerObj.getSessionCollection(application.applicationname);
nosessions=ListLen(structkeyList(activeSessions));
</cfscript>
<cfoutput>
<h3>Total Sessions : #nosessions#</h3>
</cfoutput>
<cfoutput>
<table>
<tr>
<td>Username</td>
<td>Login Date</td>
<td>IP Address</td>
</tr>
<cfloop list="#structkeyList(activeSessions)#" delimiters=","
index="i">
<cfif structKeyExists(activesessions[i], "fullname")>
<tr>
<td>#activesessions[i].fullname#</td>
<td>#dateFormat(activesessions[i].loginDate,
"short")# #timeFormat(activesessions[i].loginDate, "short")#</td>
<td><cfif structKeyExists(activesessions[i],
"ip")>#activesessions[i].ip#</cfif></td>
</tr>
</cfif>
</cfloop>
</table>
</cfoutput>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2.
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275501
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4