You are correct. You cannot (usefully) assign that string to a hash. What you need to do is split the string into individual items and assign them to the hash.
Fortunately, an array of key/value pairs can be assigned to a hash with the desired result. This often appears in code as
%hash = (key1 => value1, key2 => value2);
where the => operator is a pretty replacement for a comma.
In your specific case, you want to split() the cookie string on commas, and assign the resulting array to your hash variable. Check the perldocs for details :)