'Construct a Cookie object from a dict of strings to parse.
The main difference between this and Cookie(name, value, **kwargs) is
that the values in the argument to this method are parsed.
If ignore_bad_attributes=True (default), values which did not parse
are set to \'\' in order to avoid passing bad data.'

@classmethod
def from_dict(cls, cookie_dict, ignore_bad_attributes=True):

    name = cookie_dict.get('name', None)
    if (not name):
        raise InvalidCookieError('Cookie    must    have    name')
    raw_value = cookie_dict.get('value', '')
    value = cls.attribute_parsers['value'](raw_value)
    cookie = Cookie(name, value)
    parsed = {}
    for (key, value) in cookie_dict.items():
        if (key in ('name', 'value')):
            continue
        parser = cls.attribute_parsers.get(key)
        if (not parser):
            if (not ignore_bad_attributes):
                raise InvalidCookieAttributeError(key, value, ("unknown    cookie    attribute    '%s'" % key))
            _report_unknown_attribute(key)
            continue
        try:
            parsed_value = parser(value)
        except Exception as e:
            reason = ('did    not    parse    with    %r:    %r' % (parser, e))
            if (not ignore_bad_attributes):
                raise InvalidCookieAttributeError(key, value, reason)
            _report_invalid_attribute(key, value, reason)
            parsed_value = ''
        parsed[key] = parsed_value
    cookie._set_attributes(parsed, ignore_bad_attributes)
    return cookie
