Magento set, get and delete cookie data

1

How to magento access cookie data or create, read, and delete cookie in magento? Magento Mage_Core_Model_Cookie class can be use to get,delete and set cookie data.If you try to use normal php cookie to get data, sometimes not working.

Magento set cookie data/values

NOTE:name and value are required.Other parameters are optional and can be set as null.

Usage


Magento get all cookies data/values

Magento get specific cookie data/value


Magento delete cookie data/value

Usage


You can refer more information from app\code\core\Mage\Core\Model\Session\Abstract\varien.php of line 84.

Share.

About Author

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.