is the a way to stop multi-logins to a website to 1 connection/IP ?
let say that my website is http://website.com and i want only 1 user to browse from 1 IP !
is this possible using php, javascript or htaccess ?
i've done many test to htaccess but all failed
thanks in advance
Yes, but you shouldn't!
Assuming you just want to stop multiple users on one IP address from logging into a typical authentication system, just add two rows to your
usersdatabase table:last_ipandlast_seen.last_ipis updated on each page load if the user's IP address has changed.last_seenis updated on each page load.When a user submits a login request, check if another user's
last_ipis equal to the user's IP address andlast_seenis within a sane time period (say 30 minutes). If so, deny the login request.It's a bad idea because it's easily avoided
Using a VPN, TOR or an open proxy, it's very easy for users to operate multiple IP addresses in different browsers or even in different tabs in the same browser.
Also, looking forward to IPv6, it's likely that each user will have 64-256 IP addresses by standard.
It's also a bad idea because it harms legitimate users
Users in poor countries, multiple people living in the same home, people at colleges or workplaces may well share IPs. A user does not map well to an IP address.