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