Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the number of login attempts #104

Closed
Awilum opened this issue Mar 15, 2013 · 0 comments
Closed

Limit the number of login attempts #104

Awilum opened this issue Mar 15, 2013 · 0 comments

Comments

@Awilum
Copy link
Member

Awilum commented Mar 15, 2013

Limit the number of login attempts

possible solution

if($login_incorrect){
     if(isset($_COOKIE['login'])){
          if($_COOKIE['login'] < 3){
               $attempts = $_COOKIE['login'] + 1;
               setcookie('login', $attempts, time()+60*10); //set the cookie for 10 minutes with the number of attempts stored
          } else{
               echo 'You are banned for 10 minutes. Try again later';
          }
     } else{
          setcookie('login', 1, time()+60*10); //set the cookie for 10 minutes with the initial value of 1
     }
}
Awilum added a commit that referenced this issue Jun 30, 2013
Awilum added a commit that referenced this issue Jun 30, 2013
@Awilum Awilum closed this as completed Jun 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant