CodeIgniter Session spammed by bots |
hello,
my website has visits from various search engine bots. I would like to ignore the bots from the session table. i tried with this library https://github.com/donjakobo/codeigniter-clean-sessions but didn't work with ci 3. Any help?
I'm not sure how well this would work, as it would depend at least somewhat on your site's ability to continue to function without a session, but you could extend the sessions library in a similar fashion to the library you linked by creating a file in /application/libraries/Session/MY_Session.php:
PHP Code: <?php This also depends on the ability to access the loader (and, in turn, the user_agent library) at the time the session library is loaded. Note that this should be the entire contents of the new file. All it does is load the user_agent library to check whether it can identify a robot. If it identifies a robot, it logs a debug message and exits. Otherwise, it turns control back over to the parent, making sure to pass along any parameters which may have been passed by the loader.
mwhitney, thank u. I use this construction, work it.
but I edit this array list maybe somebody need this. PHP Code: $robots = array(
I am developing an Anti-Scraping library
https://github.com/terrylinooo/Codeignit...ng-Library Just completed the document, still testing it. I will uplodad the library soon..
Personal blog: https://terryl.in
My personal project is called Dictpedia is currently using Codeigniter 3, welcome.
Maybe it is a simple solution where you have a blacklist in MY_Session.php:
Code: <?php |
Welcome Guest, Not a member yet? Register Sign In |