code: def save_cookies(self, ignore_discard=True, ignore_expires=True):
          
          if not isinstance(self.cookies, cookielib.FileCookieJar):
              m = 'Cookies must be a cookielib.FileCookieJar object to be saved.'
              raise APIError(m)
          self.cookies.save(ignore_discard=ignore_discard,
                            ignore_expires=ignore_expires)
docs: Save cookies to the file :attr:`.API.cookies_filename`