Cookie header parsing

Write codeEasy15 minStripe and Shopify style

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) -> dict
Example 1
Inputparse_cookies("sessionId=abc123; theme=dark")
Output{"sessionId": "abc123", "theme": "dark"}