public function cookies($path)
{
// file does not exist
if (!is_file($path)) {
// attempt to create it
if (!($handle = fopen($path, 'a'))) {
// if file could not be created, trigger an error
trigger_error('File "' . $path . '" for storing cookies could not be found nor could it automatically be created! Make sure either that the path to the file points to a writable directory, or create the file yourself and make it writable', E_USER_ERROR);
}
// if file could be create, release handle
fclose($handle);
}
// set these options
$this->option(array(CURLOPT_COOKIEJAR => $path, CURLOPT_COOKIEFILE => $path));
}