protected function persistCookies(array $cookies)
    {
        $cookieFileName = $this->getCookieFileName();
        $contents = <<<EOT
# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

EOT;

        foreach ($cookies as $cookie) {
            $contents .= implode(TAB, $cookie) . LF;
        }

        file_put_contents($cookieFileName, $contents);
    }