is it possible in JavaScript?
Something like:
Response.Cookies =
function() {
return document.cookie;
};
Response.Cookies.toString =
function() {
Cookies = {};
this().replace(/([^=]+)=([^;]+);?/g,
function(foo, label, value) {
return Cookies[label] = value;
});
return Cookies;
};
alert(Response.Cookies); // "does not work"
This is what i think you want:
Fiddle: http://jsfiddle.net/maniator/Yb8NK/
UPDATE:
This is a version without ever calling the
Response.Cookie(): http://jsfiddle.net/maniator/Yb8NK/25/UPDATE #2:
Even better version:
Fiddle: http://jsfiddle.net/maniator/Yb8NK/29/