Block concurrent logins

4 views
Skip to first unread message

Nich

unread,
Nov 4, 2010, 9:01:28 AM11/4/10
to Object-Oriented Programming in ColdFusion
Hello folks,
Hoping that I could get help to prevent concurrent logins with the
same account.
I'm using the default Application.cfc login procedure.
Was thinking of setting the logged status to "1" for that user, when
the user logs in, then set it to "0" when the user logs out or when
the session expires.
When another person tries to login with the same details from
elsewhere, it blocks, because the logged status will be "1".
I've done all the above other than changing the status to "0" when the
session expires.
I put the code in onSessionEnd, but the code is not being executed.

<cffunction name="onSessionEnd" returnType="void">
<cfquery name="updateloggedstatus" datasource="datadsn">
UPDATE usermanagerlogin
SET
logged = '0'
WHERE userid = 'manager'>
</cfquery>
</cffunction>

On cf9, any Ideas?
Thank you,
Nich

Dennis Clark

unread,
Nov 4, 2010, 10:28:44 AM11/4/10
to coldfu...@googlegroups.com
Could it be that your onSessionEnd is firing but you have a SQL syntax error near '>' with nothing to catch the run-time exception?

-- Dennis


--
You received this message because you are subscribed to the Google Groups "Object-Oriented Programming in ColdFusion" group.
To post to this group, send email to coldfu...@googlegroups.com.
To unsubscribe from this group, send email to coldfusionoo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/coldfusionoo?hl=en.


Nich

unread,
Nov 5, 2010, 2:04:18 PM11/5/10
to Object-Oriented Programming in ColdFusion
Brilliant observation Dennis, keep it up!
Nich.


On Nov 4, 5:28 pm, Dennis Clark <boomf...@gmail.com> wrote:
> Could it be that your onSessionEnd is firing but you have a SQL syntax error
> near '>' with nothing to catch the run-time exception?
>
> -- Dennis
>
> > coldfusionoo...@googlegroups.com<coldfusionoo%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages