I have this simple click limit for my site using sessions, I would just like to know if this is ok, or an acceptable way of checking for rapid page refreshes.
This code is at the top of each page, before it requests data from the db.
session_start();
$now = date('Y-m-d H:i:s', time());
if ($_SESSION['click'] > date("Y-m-d H:i:s", strtotime("$now - 1 second"))) {
exit("You're clicking too fast") ;
}
$_SESSION['click'] = $now;
Basically this does the same but with less functions,