Question

I'm using cfloginuser as a security mechanism in my application to secure web service calls that are being made.

One thing I would like to do is stop a second user from logging into the same account when they are already logged into another computer. Essentially what's happening, is that since both share the same username, the first one to login just gets kicked out as a logged in a user once the second login occurs.

Is there anyway I can check if a particular username is already logged in, therefore not even allowing the second login to even authenticate? (You can only be logged into one computer at a time)

Was it helpful?

Solution

The only way I can think of would be to store the user name in the application scope, and then remove it when they sign out. (and add it OnSessionEnd in your application.cfc in case they don't click the sign out link)

Then, when a user signs in, check the list of signed in users in your application scope, and don't allow them to do it a second time if the name is there.

Do keep in mind what Peter said, though. I think it is a good point.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top