public function regenerateToken($name = null)
    {
        $this->initialize();

        $name                 = $this->hashName($name);
        $this->tokens[$name]  = $this->getUniqueToken();

        if (!isset($_SESSION[$this->key]) || !is_array($_SESSION[$this->key])) {
            $_SESSION[$this->key] = [];
        }

        $_SESSION[$this->key][$name] = $this->tokens[$name];

        return $this->tokens[$name];
    }