simian
simian

Reputation: 126

PHP magento cookie encryption

I want to set a cookie with but encrypt the information and decrypt when retrieving. Are there any Magento classes I can use?

I am running Magento 1.4.1.1 and I am setting my cookies with:

 Mage::getModel('core/cookie')->set($name, $value, $period, $path, $domain, $secure, $httponly);

Any help would be appreciated.

Upvotes: 0

Views: 919

Answers (1)

MagePsycho
MagePsycho

Reputation: 2004

In Magento, you can encrypt the data using:

Mage::getModel('core/encryption')->encrypt($data);

and decrypt using:

Mage::getModel('core/encryption')->decrypt($data);

Upvotes: 7

Related Questions