Magento Set Get and Delete cookie in Magento Client Side – javascript

var name = 'Aman';
Mage.Cookies.set('name',name);

var name = Mage.Cookies.get('name');
alert(name);

Mage.Cookies.clear('name');
Advertisements