code: def parse_one_response(line, ignore_bad_cookies=False,
                         ignore_bad_attributes=True):
      
      cookie_dict = {}
      # Basic validation, extract name/value/attrs-chunk
      match = Definitions.SET_COOKIE_HEADER_RE.match(line)
      if not match:
          if not ignore_bad_cookies:
              raise InvalidCookieError(data=line)
          _report_invalid_cookie(line)
          return None
      cookie_dict.update({
          'name': match.group('name'),
          'value': match.group('value')})
      # Extract individual attrs from the attrs chunk
      for match in Definitions.ATTR_RE.finditer(match.group('attrs')):
          captured = dict((k, v) for (k, v) in match.groupdict().items() if v)
          unrecognized = captured.get('unrecognized', None)
          if unrecognized:
              if not ignore_bad_attributes:
                  raise InvalidCookieAttributeError(None, unrecognized,
                                                    "unrecognized")
              _report_unknown_attribute(unrecognized)
              continue
          # for unary flags
          for key in ('secure', 'httponly'):
              if captured.get(key):
                  captured[key] = True
          # ignore subcomponents of expires - they're still there to avoid doing
          # two passes
          timekeys = ('weekday', 'month', 'day', 'hour', 'minute', 'second',
                      'year')
          if 'year' in captured:
              for key in timekeys:
                  del captured[key]
          elif 'year2' in captured:
              for key in timekeys:
                  del captured[key + "2"]
          cookie_dict.update(captured)
      return cookie_dict
docs: Turn one 'Set-Cookie:' line into a dict mapping attribute names to
      attribute values (raw strings).