Configuration

You can adjust the setting when initializing Shieldon instance, or using setProperty or setProperties API later.

Initializing


$config = [
    'time_unit_quota' => [
        ['s' => 2, 'm' => 10, 'h' => 30, 'd' => 60]
    ]
];

$shieldon = new \Shieldon\Shieldon($config);

setProperty

$shieldon->setProperty('time_unit_quota', [
    's' => 2, 'm' => 10, 'h' => 30, 'd' => 60
]);

setProperties


$config = [
    'time_unit_quota' => [
        ['s' => 2, 'm' => 10, 'h' => 30, 'd' => 60]
    ]
];

$shieldon->setProperties($config);

Default

key type value
time_unit_quota array ['s' => 2, 'm' => 10, 'h' => 30, 'd' => 60]
time_reset_limit integer 3600
interval_check_referer integer 5
interval_check_session integer 30
limit_unusual_behavior array ['cookie' => 5, 'session' => 5, 'referer' => 10]
cookie_name string ssjd
cookie_domain string "

time_unit_quota

Setting the limits and quotas for your vistors on your website.

You may check out your Google Analytics to find out how many page views per user is normal condition, then think about what is considered to bad behavior on your website.

  • array
key value description
s intiger Page views per vistor per second
m intiger Page views per vistor per minute
h intiger Page views per vistor per hour
d intiger Page views per vistor per day

Tips

  • If you just want to limit an user to view 100 pages a day, just set s, m, h to a very high number, and set d to 100.

  • To remember, when users reached the limit will just be banned temporaily, they can get unbanned by solving Captcha, so, do not set the values too loose, overwise it is no sense to use this library.

time_reset_limit

Reset the filiters flagged number after how many seconds that time_reset_limit is set.

interval_check_referer

When an user first time visit to your website by entering URL on browser, the HTTP_REFERER is empty. After interval_check_referer seconds, Shieldon will start checking HTTP_REFERER.

You can ignore this value.

interval_check_session

When an user first time visit to your website, after interval_check_session seconds, Shieldon will start checking SESSION cookie.

limit_unusual_behavior

Setting the limits and quotas of being flagged as unusual behavior for your vistors on your website.

  • array
key value description
cookie intiger Cookie generated by JavaScript.
session intiger PHP Session
referer intiger HTTP_REFERER

Others

Please ignore them.

results matching ""

    No results matching ""