Cookie header parsing
Your task
Parse an HTTP Cookie header value into a dict. The header is a string of '; '-separated pairs like 'sessionId=abc123; theme=dark'. Each pair is 'name=value'; a bare token with no '=' maps to an empty-string value. Trim surrounding whitespace from names and values. Return an empty dict for an empty header.
Examples
parse_cookies(header: str) -> dictExample 1
Input
parse_cookies("sessionId=abc123; theme=dark")Output
{"sessionId": "abc123", "theme": "dark"}