В интернете море информации по работе с cookies…
var cookie = {
set: function(cookie_name, cookie_value, cookie_expire) {
var expire_date = new Date;
expire_date.setDate(expire_date.getDate() + cookie_expire);
document.cookie = cookie_name + "=" + escape(cookie_value) + (cookie_expire == null ? "" : ";expires=" + expire_date.toGMTString());
},
get: function(cookie_name) {
var cookie = document.cookie, length = cookie.length;
if(length) {
var cookie_start = cookie.indexOf(cookie_name + "=");
if(cookie_start != -1) {
var cookie_end = cookie.indexOf(";", cookie_start);
if(cookie_end == -1) {
cookie_end = length;
}
cookie_start += cookie_name.length + 1;
return unescape(cookie.substring(cookie_start, cookie_end));
}
}
return null;
},
erase: function(cookie_name) {
core.cookies.set(cookie_name, "", -1);
}
};
cookie.set("test", "O_o");
alert(cookie.get("test"));