On this site if you do too many clicks or post comments too fast or something like that you get redirected to the "Are you a human" screen. Does anybody know how the developers of this site did this, or how to do something similar?
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
migrated from stackoverflow.com Mar 4 '10 at 15:59
This question came from our site for professional and enthusiast programmers.
Now all this question needs is to be moved back to stackoverflow!
It's almost certainly a heuristic that tries to "guess" that a user is some form of automated process, rather than a person, for example:
Ordinarily the "x" and "y" values would be formulated to be ones that it would be unlikely for a "real person" to do, like:
Once you've got your set of rules, you can then implement some code that checks them at the start of each request, be it in a method that's called in Page_Load, something in your masterpage, something in the asp.net pipeline, that's the easy bit! ;)
just check how many hit / minutes you get from a specific ip or session or whatever and decide what are your preferred threshold and your good to go
At a guess...
Write a HTTP handler that records requests and store them in session.
When a new request comes in, check to see how many requests are stored (and expire old ones).
If the amount of requests in the past few minutes exceeds a given threshold, redirect the user.
If you're doing this in ASP.NET webforms, you could do this check on the site master page, ( or write a
If you're using an MVC framework, you could write a base controller that does this check for every action.
With rails, you could write a
With asp.net MVC, you could write a
I'd also check the user agent header of the request - if it doesn't look like a popular browser (or is empty) then throw the "are you a human?" page.