Benoit Hediard wrote:
> Hi everyone,
>
> Looking for an article on CFMX SessionTracker.

Not sure about that but Ray Camden had a recent article in the
ColdFusion Developers Journal on a CFMX session tracker:

http://www.sys-con.com/coldfusion/articleprint.cfm?id=654

hth,

larry

>
> We have put in place a session tracker to count the number of sessions on
> our application.
>
> <cfset tracker = createObject("java","coldfusion.runtime.SessionTracker")>
> <cfset sessions = tracker.getSessionCollection("MyApp")>
> <cfset sessionsNb = structCount(sessions)>
>
> This is working fine.
> But we have recently replace the last line by :
>
> <cfset sessionsNb = 0>
> <cfloop collection="#sessions#" item="ID">
> <cfif structKeyExists(sessions[ID],"member")>
> <cfset sessionsNb = sessionsNb + 1>
> </cfif>
> </cfloop>
>
> An advice, don't do this kind of manipulation on a regular basis (for
> example with a scheduled task), because it creates a huge memory leak :
> sessions will never expire!
> It is probably because you "touch" the session content, so it changes the
> timestamp of all the sessions...
>
> I'm pretty sure I've read an article concerning this issue on a CF blog
> somewhere.
> If I remember well, the author was showing how to use java reflection to
> workaround it.
> Can't find it in the archives of CF blogs or even in google.
>
> Anyone remember this?
>
> Benoit Hediard
> www.benorama.com
> www.affinitiz.com
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to