Hi, i have noticed that Twitter and Facebook both have a good system in place on some of their forms. For example, if a user fails to enter their correct details in to the Sign In Form 3-4 times, a reCaptcha shows. I also noticed that the reCaptcha shows on the Sign Up Form after it detects suspicious activity... Can anyone think how they might have implemented this system, as i really don't want to display a reCaptcha form my default... i would rather only display it if there was suspicious activity. (please do not respond saying that captchas are a waste of time etc... i am simply only interested in finding out how Twitter and Facebook are implementing captchas when they detect something suspicious Thanks in advance for your help...
The simplest way is to track activity via a cookie. Store a random id in a cookie. Use the id to look up the info in your database. Keep track of how many in correct logins in a single day. Then display the captcha.
Thanks, i was thing of doing the following: When validating the sign-up form, check to see if an account has been created from the same ip address within the last minute (or less)… if it has, fail the validation and display a captcha
it looks like you are trying to stop bots to sign up. it is not uncommon for bots to have delays build in so that it is more difficult to get caught. Also your way would have another big issue. If your website is for example being used by students when they are at uni. suddenly you have multiple people with the same IP using your site. so you might penalise them all ( if loads of them would sign up at the same time ).
Ok, thanks... what you said makes perfect sense... so how would implement a smilar system to stop bots signing up...
Or just keep a count in the cookie. If the user signs in successfully on the second or third attempt, delete the cookie. If they complete the captcha, delete the cookie. If the count in the cookie exceeds what you want, take the appropriate action (which may or may not include deleting the cookie - that depends on what you want to do).