I\'m opening a new thread based on this how to store an array in jquery cookie?. I\'m using function from almog.ori :
var cookieList = function(cookieName) {
var cookieList = function(cookieName) {
var cookie = Cookies.get(cookieName);
var items = cookie ? cookie.split(/,/) : new Array();
return {
"add": function(val) {
items.push(val);
Cookies.set(cookieName, items.join(','), {expires: new Date(2020, 0, 1)});
},
"remove": function(val) {
indx = items.indexOf(val);
if (indx != -1)
items.splice(indx, 1);
Cookies.set(cookieName, items.join(','), {expires: new Date(2020, 0, 1)});
},
"clear": function() {
items = null;
Cookies.set(cookieName, null, {expires: new Date(2020, 0, 1)});
},
"items": function() {
return items;
}
}
};