public function remove(string $key)
    {
        if ($this->contains($key)) {
            $res = $_SESSION[$key];
            unset($_SESSION[$key]);
            return $res;
        } else {
            return null;
        }
    }
public function remove(string $key)
    {
        if ($this->contains($key)) {
            $res = $_SESSION[$key];
            unset($_SESSION[$key]);
            return $res;
        } else {
            return null;
        }
    }
public function remove ( string $ key ) { if ( $ this -> contains ( $ key ) ) { $ res = $ _SESSION [ $ key ] ; unset ( $ _SESSION [ $ key ] ) ; return $ res ; } else { return null ; } }
It removes the variable of session by passed key.
@param string $key
@return mixed|null The removed variable value.
It removes the variable of session by passed key .