How to use Cookie with Magento?

Some time developer gets stuck with how to pass variable value from PHP to JavaScript (server side to client side). We can found a solution with cookie. Because cookie is the feature which is available at both side (PHP & JavaScript / Server side & Client side). In Magento it has in-built JS library for cookie that his js\mage\cookies.js and for php side it has cookie model (core/cookie). So in magento we do not need to write core function for cookie.   How to use cookie in JS? Set cookie value. Mage.Cookies.set(‘somename’,’somevalue’); Get Cookie value Mage.Cookies.get(‘so...
More