In simple web program I want to block users for some time in log in page if they type incorrect password for 3 times! How can I implement it? Is it good idea that store counter in datab开发者_如何学JAVAase?
This may help:
http://www.webcheatsheet.com/PHP/blocking_system_access.php
This is something that you need to implement on the server-side. Yes, you basically store the time of the next allowed login in addition to the number of consecutive failed login attempts. If you get a login request and the time is less than the first allowed login time, then you return an error code. If you get a failed login attempt, you increment the number of failed consecutive logins, set the next allowed login time to the current time plus some delay (computed based on the number of consecutive failures), and again return an error code. On a successful login, you clear the number of consecutive failures.
精彩评论