I am currently using this JQuery cookie plugin https://github.com/js-cookie/js-cookie and it is working for just single cookie value but i want it to work for multiple dynamic values stored in as an array.
For example, i have a list of the products in a page and i am showing "save products" link on each products. I want, clicking on the save button to store an id of the products in same cookies so i can retrieve all the values and display in a separate page.
I will appreciate if you can just show me how to store values in a cookies as an array i will do the rest.
HTML:
<ul>
<li id="product1">product 1 <a>Save Products</a></li>
<li id="product2">product 2 <a>Save Products</a></li>
</ul>
JQUERY:
$('ul li a').each(function(){
$('this').click(function(){
Cookies.set('SavedProducts', { foo: 'bar' });
});
});