Suppose I have 2 users A and B trying to login from the same PC into my website.
A is currently logged in. B uses the same PC and opens a new tab and tries to login.(A hasn't logged out yet)How do I prevent B from login unless A logs out?

I have used PHP sessions which prevents A from logging in again without logging out but it doesn't stop B from logging in.