class CookieJar {

    public static Map<String, String> decodeCookies(String header) {
        Map<String, String> cookies = new HashMap<>();
        String [] cookiePairs = header.split(";");
        if (cookiePairs.length != 0) {
            for (String cookiePair : cookiePairs) {
                String[] keyVal = cookiePair.split("=");
                if (keyVal.length == 2) {
                    cookies.put(keyVal[0].trim(), keyVal[1].trim());
                }
            }
        }
        return cookies;
    }

}