/** * Decrypt set * @param \Slim\Interfaces\CryptInterface $crypt * @return void * @api */ public function decrypt(CryptInterface $crypt) { foreach ($this->data as $key => $value) { $this->set($key, $crypt->decrypt($value)); } }
/** * Encrypt cookies * * This method iterates and encrypts data values. * * @param \Slim\Interfaces\CryptInterface $crypt * @api */ public function encrypt(CryptInterface $crypt) { foreach ($this as $name => $settings) { $settings['value'] = $crypt->encrypt($settings['value']); $this->set($name, $settings); } }