문제

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)

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top