#20 Max login attempt checking

open
nobody
5
2009-04-23
2009-04-23
Nicolas Liaudat
No

------------- login.php

if (!isset($GLOBALS['__SESSION']['access_count'])) {
$GLOBALS['__SESSION']['access_count']=1;
}
else {
$GLOBALS['__SESSION']['access_count']++;
}
if($GLOBALS['__SESSION']['access_count']>5) {
unset($GLOBALS['__SESSION']['access_count']);
$GLOBALS['__SESSION'] = array(); // reset session array
session_destroy(); // destroy session.
die($GLOBALS["messages"]["maxloginattempt"]); //You exceed the maximum number of login attempts.
}

-------------------- login.php

Regards
Nicolas Liaudat

Discussion