How can I have one user logged in

Hey there! Not sure how to put this question :smile:
How can I restrict logged in users to one session. For example if I login on my phone, I cant login on my computer or my friends computer. The idea is that I want to sell membership to my site to people that know each other. I dont want them to give their friends their username and password.