Back to JoomlaStorage class

Method remove

public mixed
remove
(string $name)
Unset a variable from the session store
Parameters
  • string $name Name of variable
Returns
  • mixed The value from session or NULL if not set
Since
  • 4.0.0
Class: JoomlaStorage
Project: Joomla

Method remove - Source code

/**
 * Unset a variable from the session store
 *
 * @param   string  $name  Name of variable
 *
 * @return  mixed  The value from session or NULL if not set
 *
 * @since   4.0.0
 */
public function remove(string $name)
{
    if (!$this->isStarted()) {
        $this->start();
    }
    $old = $this->data->get($name);
    unset($this->data[$name]);
    return $old;
}