Joe Eugene
Tue, 02 Feb 2010 10:33:17 -0800
If all you need to On 10/25/05, Douglas Knudsen <douglasknud...@gmail.com> wrote:you can also get this programaticaly using the coldfusion.runtime objects. Here is some hack code for an example
<!--- define the application ---><cfapplication name="sessionLister" sessionmanagement="Yes" sessiontimeout="#createtimespan(0,0,2,0)#">
<!--- application tracker object ---><cfset appObj = createObject ("java","coldfusion.runtime.ApplicationScopeTracker")>
<!--- get the enumeration of application keys ---> <cfset apps = appObj.getApplicationKeys ()> <!--- session tracker object ---><cfset tracker = createObject("java", "coldfusion.runtime.SessionTracker")>
<table border="1" width="100%">
<tr>
<th>APPLICATIONS</th>
<th>SESSIONS</th>
<th>SESSION DATA</th>
</tr>
<tr>
<td valign="top">
<!--- while there are more applications in the enumeration --->
<cfloop condition="#apps.hasMoreElements()#">
<!--- get the app name --->
<cfset appname = apps.nextElement()>
<a href="?appname=<cfoutput>#appname#</
cfoutput>"><cfoutput>#appname#</cfoutput></a> <br>
<cfdump var="#appObj.getApplicationScope(appname)#"
label="Application struct for #appname#"><br>
<!--- <!--- get the sessions for this app name --->
<cfset sessions = tracker.getSessionCollection(appname)>
<!--- dump the sessions out --->
<cfdump var="#sessions#" label="#appname#"> --->
</cfloop>
</td>
<td valign="top" nowrap>
<cfif IsDefined(" url.appname") AND Len(url.appname)>
<cfset dakeys = StructKeyList(tracker.getSessionCollection
(url.appname))>
<strong><cfoutput>#ListLen(dakeys)#</cfoutput> </
strong>SESSIONS FOR APPLICATION <strong><cfoutput>#url.appname#</
cfoutput></strong>:<br>
<cfloop list="#dakeys#" index="i">
<a href="?appname=<cfoutput>#url.appname#&sid=#i#</
cfoutput>"><cfoutput>#i#</cfoutput></a> <br>
</cfloop>
</cfif>
</td>
<td valign="top">
<cfif IsDefined("url.appname") AND Len(url.appname) AND
IsDefined(" url.sid") AND Len(url.sid)>
THE SESSION DATA FOR SESSION:
<strong><cfoutput>#url.sid#</cfoutput></strong>:<br>
<cfdump var="#tracker.getSession( url.sid)#">
</cfif>
</td>
</tr>
</table>
On 10/25/05, shawn.gorr...@atl.frb.org < shawn.gorr...@atl.frb.org >
wrote:
I assume that you are using the application or server scope to maintain the session count variable?
I have an example usage of Application.cfc which could be easily modified to your purposes.
http://www.illumineti.com/blog/index.cfm?mode=entry&entry=FE15A1ED-C09F-25C5-830E814E5B7420B3 Tom Chambers <ac...@chamberssystems.com> 10/25/2005 11:26 AM Please respond to discussion@acfug.org To discussion@acfug.org cc Subject CFMX7 & session count Hi all I'm looking for a working example of how to show the current number of sessions (users) on a website. I'm utilizing the application.cfc rather than the application.cfm . I've found some suggested solutions but none of them are working examples. The site has an application scope and a session scope. I have the session count variable setup and its being incremented through the onSessionStart method. However, I am suspicious of the onSessionEnd method not decrementing the session count variable. Any help or direction would be greatly appreciated Thanks Tom -------------------------------------------------- * To unsubscribe from this list, send a * * message to discussion-requ...@acfug.org * * with the word unsubscribe in the body. * * Be sure to send your email in plain text * * format and not in HTML format! * * * * For more info, see http://www.acfug.org/ml.htm * -------------------------------------------------- -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?