You can simply use
HTTPHelper.GetUserHostAddress();
to get their IP address. Then you can use the users last logon date and last login information (holds IP they last logged in with), then depending on the license you purchased you could use the On-line users feature to see if the logging on user is already logged on. I belive you have need an Ultimate license for te On-line users feature. If you have that license, then take a look at the /CMSModules/Membership/Pages/Users/General/User_online.aspx (.cs) and that will assist you with the online users.