As part of the login system that I am doing, I track failed login attempts for a unique session named after each client:
if($login_failed) {
$session_name = 'failed_attempts'.$_SERVER['REMOTE_ADDR'];
if(!isset($_SESSION[$session_name])) {
$_SESSION[$session_name] = 1;
}
else {
$_SESSION[$session_name] += 1;
}
}
As you can see, to determine a unique name for each session, I add the user's IP address at the end of the failed_login_attempts line.
If the user reaches 5 unsuccessful attempts, I require that each subsequent attempt be filled with captcha.
I'm just worried that there may be networks where many users are assigned the same IP address, in which case if 1 user cannot log in, they will all start to see captchas, even if only one user needs to show CAPTCHA .
, 2 IP-, , 3 , , .
, IP-, , ?