>My apologies -- this will give you their total session time.  To work
>out if they've been inactive for more than 15 minutes you'll have to do
>a time check comparing the "last active" timestamp and the current time
>using now().

Hi Tim,

Thanks.  I ran your script and sure enough, right now, it says there are 99 users when it probably should be something like 20.  I'm not sure if I'm understanding you completely -- I'm thinking that I need to add to the following snippet that already exists:

<cfloop collection="#Application.UsersInfo#" item="itmUser">
    <cflock name="session-lock-#itmUser#" timeout="15">
        <cfif structkeyexists(Application.UsersInfo, itmUser)>
            <cfif DateDiff("n", Application.UsersInfo[itmUser], Now()) GT 15>
                <cfset StructDelete(Application.UsersInfo, itmUser)>
            </cfif>
        </cfif>
    </cflock>
</cfloop>

So I'd include another CFIF statement:

<cfif DateDiff("n", LAST ACTIVE, Now()) GT 15>
     <cfset StructDelete(Application.UsersInfo, itmUser)>
</cfif>

The problem is figuring out this last active number -- am I missing something simple?

Again, thanks for all your help...

- Sung
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to