On 5/28/05, Will Tomlinson <[EMAIL PROTECTED]> wrote:
> > Initialize a counter in onApplicationStart(),

<cfcomponent>

<cffunction name="onApplicationStart">
    <cfset application.numberOfSessions = 0 />
</cffunction>

> increment it in
> > onSessionStart(),

<cffunction name="onSessionStart">
    <cflock name="#this.name#_numberOfSessions" type="exclusive" timeout="10">
        <cfset application.numberOfSessions =
application.numberOfSessions + 1 />
    </cflock>
</cffunction>

> decrement it in onSessionEnd(). Remember that you
> > reference application scope via the second argument passed to
> > onSessionEnd().

<cffunction name="onSessionEnd">
    <cfargument name="sessionScope" />
    <cfargument name="applicationScope" />
    <cflock name="#this.name#_numberOfSessions" type="exclusive" timeout="10">
        <cfset arguments.applicationScope.numberOfSessions =
arguments.applicationScope.numberOfSessions - 1 />
    </cflock>
</cffunction>

</cfcomponent>

(off the top of my head - E&OE - check the docs etc)
-- 
Sean A Corfield -- http://corfield.org/
Team Fusebox -- http://fusebox.org/
Got Gmail? -- I have 50, yes 50, invites to give away!

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207965
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to