public static function parse($line)
    {
        $parts = explode("\t", trim($line));

        if (count($parts) !== 7) {
            throw new RuntimeException("Invalid cookie JAR format.");
        }

        $config = [];
        $config['httponly'] = '#HttpOnly_' === substr($parts[0], 0, 10);
        $config['domain'] = $config['httponly'] ? substr($parts[0], 10) : $parts[0];
        $config['path'] = $parts[2];
        $config['secure'] = ($parts[3] === 'TRUE') ? true : false;
        $config['expires'] = (integer) $parts[4];
        $config['name'] = $parts[5];
        $config['value'] = $parts[6];

        return $config;
    }