code: def update_cookies(self, cookies: Optional[LooseCookies]) -> None:
          
          if not cookies:
              return
  
          c = SimpleCookie()
          if hdrs.COOKIE in self.headers:
              c.load(self.headers.get(hdrs.COOKIE, ''))
              del self.headers[hdrs.COOKIE]
  
          if isinstance(cookies, Mapping):
              iter_cookies = cookies.items()
          else:
              iter_cookies = cookies  # type: ignore
          for name, value in iter_cookies:
              if isinstance(value, Morsel):
                  # Preserve coded_value
                  mrsl_val = value.get(value.key, Morsel())
                  mrsl_val.set(value.key, value.value, value.coded_value)  # type: ignore  # noqa
                  c[name] = mrsl_val
              else:
                  c[name] = value  # type: ignore
  
          self.headers[hdrs.COOKIE] = c.output(header='', sep=';').strip()
docs: Update request cookies header.