I have a login system requiring a username and password. I want to display captcha after a certain number of failed login attempts. What is the correct way to implement this? I read about it on this site, and some solutions suggest the presence of "unsuccessful attempts-counts" added to the user table. However, I need unsuccessful attempts to not be attached to a specific user - that is, I would like the image to be displayed regardless of whether the entered user name was in the system. Will this be stored in the session variable in order (I use PHP)? If so, is there not a shortage of simply throwing data into session variables as necessary? I already have a session identifier for each visitor on the site (either logged in or not),so that I can create a table that links attempts to enter this session identifier ... any ideas on what is the best / safest approach? Thanks.
Update: from the answers so far, it seems that the session identifier is not the best idea, since the hacker can just clear his cache (but is this really a problem because it will not slow down the brute force of the attack enough to make it useless?). Another option is by IP ... but I can’t decide for users on the intranet or proxy, as unsuccessful attempts will be common .... I can’t think of any other methods ... you?
source
share