How to detect whether a account has been logined in another place

hi everyone, I just want to know whehter it is possible to detect

a account has been logined or not before I login it in my program.

My program is based on web, so the user can use different browsers

to connect my server and login the account. But now, I meet some

errors, when I open two different browsers and input the same username

and password. They all can be logined. But when I try to send a message,

none of them work. I know xmpp account can be logined in different place

at the same time only if they have different resource. But in my case, the

two same account have the same resourceā€¦I think maybe it is the problem.

Thanks for your help

You are correct, you cannot have two logins with the same full JID (i.e. same user and resource). This will not work.