Answer the question
In order to leave comments, you need to log in
How to protect yourself from too frequent ajax requests?
To update the data, I use setTimeout with an ajax request, which is executed once every 10 seconds to avoid heavy loads. But the cracker dug into the chrome console and found that the user himself can form and send multiple such requests with a very short interval. It seems to me that there is only one way out, you need to somehow check the frequency of incoming requests on the server side.
I've only thought of this so far:
if ($_SESSION['time'] + 10 > time()) exit(json_encode(array('limit')));
$_SESSION['time'] = time();
Answer the question
In order to leave comments, you need to log in
You can try ready-made libraries using the "rate limiter" key
https://packagist.org/?query=rate%20limiter
Upd. Another key is "throttling/request throttling"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question