On 2/8/06, Russ <[EMAIL PROTECTED]> wrote:
> What about purging all sessions, not just the current session.... or at
> least getting a count of sessions somehow... Is that even possible?
>

As an intended feature? No. And that's something I know Adobe has
mentioned Scorpio (CF 8) will hopefully address. However, I think it
was Ray Camden who posted this code a long time ago that I've kept
around for getting the number of sessions on MX 6.1. I've not tried it
on MX 7 yet, so YMMV. It involves getting under the hood of
ColdFusion's runtime:

function getSessions(appName) {
        var tracker = createObject("java", "coldfusion.runtime.SessionTracker");
        return tracker.getSessionCollection(appName);
}

variables.numSessions = 0;
variables.sessions = getSessions(application.applicationName);
variables.numSessions = structCount(variables.sessions);

<cfoutput>Total Number of Sessions: #variables.numSessions#</cfoutput>

Hope this helps?

Regards,
Dave.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:231665
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to