Thanks to some of the members of this group I have been able to find the
code necessary to allow me to tract how many live sessions exist on the site
at any one time
the output of the code provides the users ip address and the time the
session has been idle.
I am wondering how I can have it so that instead of displaying the ip
address I can detect the login name of that user logged on. I tried it to
the best of my ability and I ended up displaying my session name across
several other sessions who were logged in at the one time
here is the code on the output page that may assist you in assisting me with
my question:
<cflock name="#APPLICATION.applicationName#"
type="Exclusive"
timeout="20"
throwontimeout="Yes">
<table border="2" cellspacing="0" width="95%">
<tr bgcolor="##cccccc">
<td><font size=1><b>User (by IP-address)</font></b></td>
<td><b><font size=1>Session-Status</font></b></td>
</tr>
<CFLOOP collection=#APPLICATION.SessionTracker# item="aUser">
<cfset onlineSince = StructFind(APPLICATION.SessionTracker, aUser)>
<CFIF DateCompare(onlineSince+theTimeout, Now()) EQ 1>
<!--- User�s last activity lies within session-timeout,
so his/her session is active --->
<cfset inactiveSince = DateDiff("n", onlineSince, Now())>
<!--- The threshold for coloring the report
may be set individually: --->
<cfif inactiveSince LTE 2>
<cfset theColor = "Red">
<cfelseif inactiveSince LTE 5>
<cfset theColor = "Yellow">
<cfelse>
<cfset theColor = "Cyan">
</cfif>
<!--- Output of current user in report --->
<tr>
<td bgcolor="##eeeeee"><font size="1">#aUser#</font></td>
<td bgcolor="#theColor#"><font size="1">
inactive since <b>#inactiveSince#</b> mins
</font></td>
</tr>
<CFELSE>
<!--- User�s session has timed-out, so we can
delete his IP from the Session-Tracker --->
<cfset dummy = StructDelete(APPLICATION.SessionTracker, aUser)>
</CFIF>
</CFLOOP>
<tr>
<td COLSPAN="2" ALIGN=CENTER><font
size=1>#StructCount(APPLICATION.SessionTracker)# Users online</font></td>
</tr>
</table>
</cflock>
Kind Regards
Claude Raiola (Director)
AustralianAccommodation.com Pty. Ltd.
Website: www.AustralianAccommodation.com
Email: [EMAIL PROTECTED]
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message
to [EMAIL PROTECTED] with 'unsubscribe' in the body.