Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Session spammed by bots
#5

(This post was last modified: 05-21-2016, 01:14 PM by skunkbad.)

Maybe it is a simple solution where you have a blacklist in MY_Session.php:


Code:
<?php
class MY_Session extends CI_Session {

    public function __construct(array $params = array())
    {
        $CI =& get_instance();

        $blacklist = [
            '123.255.123.255',
            'MegaBot',
            'Whatever'
        ];

        foreach( $blacklist as $bot )
        {
            if(
                stripos( $_SERVER['HTTP_USER_AGENT'], $bot ) !== FALSE OR
                $CI->input->ip_address() == $bot
            )
            {
                return;
            }
        }

        parent::__construct($params);
    }
}
Reply


Messages In This Thread
CodeIgniter Session spammed by bots - by jimbon - 09-07-2015, 03:42 AM
RE: CodeIgniter Session spammed by bots - by skunkbad - 05-21-2016, 01:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB