hi,
Well I am not going to write a code for you here but I will guide you to overcome your issue. I had similar issue when I was working on a project. I then created a table in database named
LogedInUsers
with UserID as foreign key there. On the login page add an entry in this table for the current user and delete it on sign out.
Before the login check logic just add a check in the
LogedInUsers
table if this UserID is exist in this table or not, if exist then show a message to user that 'This user is already loged in.'
where UserID not in (select UserID from LogedInUsers )
Hope you get an idea and able to solve your problem.