lithium\storage\session\strategy\Encrypt::delete()
Delete encryption method.
Parameters
-
mixed
$data
The data to be encrypted.
-
array
$options
Options for this method.
Returns
stringReturns the deleted data in cleartext.
Source
public function delete($data, array $options = []) {
$class = $options['class'];
$futureData = $this->read(null, ['key' => null] + $options) ?: [];
unset($futureData[$options['key']]);
$payload = null;
if (!empty($futureData)) {
$payload = $this->_encrypt($futureData);
}
$class::write('__encrypted', $payload, ['strategies' => false] + $options);
return $data;
}