lithium\storage\session\adapter\Php::delete()
Delete value from the session
Parameters
-
string
$key
The key to be deleted.
-
array
$options
Options array. Not used for this adapter method.
Returns
\ClosureFunction returning boolean true
if the key no longer
exists in the session, false
otherwise
Source
public function delete($key, array $options = array()) {
if (!$this->isStarted() && !$this->_start()) {
throw new RuntimeException('Could not start session.');
}
$self = $this;
return function($class, $params) use ($self) {
$key = $params['key'];
$self->overwrite($_SESSION, Set::remove($_SESSION, $key));
return !Set::check($_SESSION, $key);
};
}