JavaScript Snippet - 123 Cookie To Hash Enumerator

Posted at

(function(cookie, hash){
cookie.replace(/([^\\=\\;]*)\\=([^\\;]*);{0,1}\\ {0,1}/img,function(full, cname, cvalue){
hash[cname] = decodeURIComponent(cvalue);
});
return hash;
}(
document.cookie
, {}
));