public static function toJar($cookies)
    {
        $result = [];
        foreach ($cookies as $name => $cookie) {
            if (!$cookie->expired()) {
                $result[] = static::_line($name, $cookie);
            }
        }
        return $result ? join("\n", $result) . "\n" : '';
    }