Cake\Network\Session::delete PHP Method

delete() public method

Removes a variable from session.
public delete ( string $name ) : void
$name string Session variable to remove
return void
    public function delete($name)
    {
        if ($this->check($name)) {
            $this->_overwrite($_SESSION, Hash::remove($_SESSION, $name));
        }
    }

Usage Example

 /**
  * {@inheritDoc}
  */
 public function redirectUrl($url = null)
 {
     if ($url === null) {
         return $this->_session->read($this->_config['redirect']);
     }
     if ($url === false) {
         $this->_session->delete($this->_config['redirect']);
         return null;
     }
     $this->_session->write($this->_config['redirect'], $url);
 }
All Usage Examples Of Cake\Network\Session::delete