public function getCookies(): array
    {
        $cookies = [];
        $cookieFileName = $this->getCookieFileName();
        if (!file_exists($cookieFileName)) {
            return $cookies;
        }

        $contents = file_get_contents($cookieFileName);
        $lines = explode(LF, $contents);
        foreach ($lines as $line) {
            if (empty($line) || $line{0} === '#') {
                continue;
            }
            $data = explode(TAB, $line);
            $cookie = array_combine(
            /** @see http://www.cookiecentral.com/faq/#3.5 */
                ['domain', 'flag', 'path', 'secure', 'expiration', 'name', 'value'],
                $data
            );

            $cookies[$cookie['name']] = $cookie;
        }

        return $cookies;
    }