Another simple, minimal Javascript snippet - how to read, save and delete cookies.

var COOKIES = {};
COOKIES.load = function() {
    COOKIES.map = {};
    document.cookie.replace(/([^ ;=]*)=([^;]*)/g,function(s,k,v){
        if (undefined === COOKIES.map[k]) {
            COOKIES.map[k] = [];
        }
        COOKIES.map[k].push(COOKIES.decode(v));
    });
    for (var k in COOKIES.map) {
        var a = COOKIES.map[k];
        COOKIES.map[k] = ((1 == a.length) ? a[0] : a);
    }
};
COOKIES.encode = function(s) {
    var v = s.replace(/%/g,'%0').replace(/;/g,'%1');
    return ((v == s) ? s : ('%%' + v));
};
COOKIES.decode = function(s) {
    return (/^%%/.test(s) ? s.substring(2).replace(/%1/g,';').replace(/%0/g,'%') : s);
};
COOKIES.save = function(k,v,t) {
    if (undefined === t) {
        t = '';
    } else {
        var now = new Date();
        now.setTime(now.getTime() + t);
        t = '; expires=' + now.toGMTString();
    }
    document.cookie = k + '=' + COOKIES.encode(v) + t;
    COOKIES.load();
};
COOKIES.load();

Cookies are encoded and decoded as needed. Value for cookie “abc” is accessible via COOKIES.map.abc. When there are multiple cookies with the same name (and different path), the cookie value is an array. No real attempt to support all the options when saving a cookie, since document.cookie = "name=value; path=/foo; expires=..." is already simple.

Try it out on the test page.  Code can be found in base.js.