lithium\storage\session\adapter\Php::delete PHP Method

delete() public method

Delete value from the session
public delete ( string $key, array $options = [] ) : Closure
$key string The key to be deleted.
$options array Options array. Not used for this adapter method.
return Closure Function returning boolean `true` if the key no longer exists in the session, `false` otherwise
    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);
        };
    }