prevent multiple login with same account

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 22, 2015   (RSS)

By ht1080z - May 18, 2015

Dear iTools Team,

I am using the latest cmsBuilder with the  Website Membership 1.10 and I need to protect the membership area from multiple login at the same time from the same account. (maybe in 20min. period twice if the account used from different IP...)

How can i set up a session that works with membership add-on?

Please advise,
Karls

By Dave - May 19, 2015

Hi Karls, 

That's a tricky one.  It's perfectly valid for a user requests to come from multiple IPs (if the ISP or router load balances over multiple connections).  It's also perfectly valid to have a thousands users behind one IP (such as a university or mobile phone network).  So you can't reliably use the IP address as a unique identifier.  

You could probably write a plugin that set a cookie or session variable to a random value on login, stored that value in the user's record in a new field, and then force logout any user that didn't have that value. Two users logging into the same account would keep getting logged out in that way.  

If you're worried about an account getting used by many users, though, what you could do is log the last 5 IPs and login/access dates for each user and then disable or temp ban any accounts that use more than X IPs in Y minutes.

Hope that helps!  Let me know any questions.

Dave Edis - Senior Developer
interactivetools.com