code: def handle_cookies(response, exc=None):
      '''Handle response cookies.
      '''
      if exc:
          return
      headers = response.headers
      request = response.request
      client = request.client
      response._cookies = c = SimpleCookie()
      if 'set-cookie' in headers or 'set-cookie2' in headers:
          for cookie in (headers.get('set-cookie2'),
                         headers.get('set-cookie')):
              if cookie:
                  c.load(cookie)
          if client.store_cookies:
              client.cookies.extract_cookies(response, requestf handle_cookies(response, exc=None):
      '''Handle response cookies.
      '''
      if exc:
          return
      headers = response.headers
      request = response.request
      client = request.client
      response._cookies = c = SimpleCookie()
      if 'set-cookie' in headers or 'set-cookie2' in headers:
          for cookie in (headers.get('set-cookie2'),
                         headers.get('set-cookie')):
              if cookie:
                  c.load(cookie)
          if client.store_cookies:
              client.cookies.extract_cookies(response, request)
docs: Handle response cookies.