diff --git a/classes/robot/crawler.php b/classes/robot/crawler.php index f370699..24e926e 100644 --- a/classes/robot/crawler.php +++ b/classes/robot/crawler.php @@ -1089,7 +1089,11 @@ private static function determine_filesize($curlhandle, $method, $success, $body public function scrape($url) { global $CFG; - $cookiefilelocation = $CFG->dataroot . '/tool_crawler_cookies.txt'; + + static $cookiefilelocaion = ''; + if (!$cookiefilelocation) { + $cookiefilelocation = make_request_directory() . '/tool_crawler_cookies.txt'; + } $config = self::get_config(); $version = moodle_major_version();