'Parse \'Cookie\' header data into Cookie objects, and add them to
this Cookies object.
:arg header_data: string containing only \'Cookie:\' request headers or
header values (as in CGI/WSGI HTTP_COOKIE); if more than one, they must
be separated by CRLF (\r\n).
:arg ignore_bad_cookies: if set, will log each syntactically invalid
cookie (at the granularity of semicolon-delimited blocks) rather than
raising an exception at the first bad cookie.
:returns: a Cookies instance containing Cookie objects parsed from
header_data.
.. note::
If you want to parse \'Set-Cookie:\' response headers, please use
parse_response instead. parse_request will happily turn \'expires=frob\'
into a separate cookie without complaining, according to the grammar.'

def parse_request(self, header_data, ignore_bad_cookies=False):

    cookies_dict = _parse_request(header_data, ignore_bad_cookies=ignore_bad_cookies)
    cookie_objects = []
    for (name, values) in cookies_dict.items():
        for value in values:
            cookie_dict = {'name': name, 'value': value}
            try:
                cookie = Cookie.from_dict(cookie_dict)
            except InvalidCookieError:
                if (not ignore_bad_cookies):
                    raise
            else:
                cookie_objects.append(cookie)
    try:
        self.add(*cookie_objects)
    except InvalidCookieError:
        if (not ignore_bad_cookies):
            raise
        _report_invalid_cookie(header_data)
    return self
