I have also also handled the same type of situation.I used SQL server for it.When a user logged in by a ID,I make a entry in DB,whenever any user try to log in ,it first check whether there is any entry to corresponding ID in DB,if yes,then showing the message the user is already logged in.
Cheers!! Brij