public function onLogoutSuccess(Request $request)
    {
        phpCAS::setDebug($this->cas->getDebug());
        phpCAS::setVerbose($this->cas->isVerbose());
        if (!phpCAS::isInitialized()) {
            phpCAS::client(
                $this->cas->getVersion(),
                $this->cas->getHostname(),
                $this->cas->getPort(),
                $this->cas->getUrl()
            );
        }
        phpCAS::setLang($this->cas->getLanguage());

        if ($this->cas->isRedirectingAfterLogout()) {
            $uri = $this->router->generate(
                $this->cas->getRouteLogout(),
                [],
                UrlGeneratorInterface::ABSOLUTE_URL
            );
            phpCAS::logoutWithRedirectService($uri);
        } else {
            //simple logout
            phpCAS::logout();
        }
    }
public function onLogoutSuccess(Request $request)
    {
        phpCAS::setDebug($this->cas->getDebug());
        phpCAS::setVerbose($this->cas->isVerbose());
        if (!phpCAS::isInitialized()) {
            phpCAS::client(
                $this->cas->getVersion(),
                $this->cas->getHostname(),
                $this->cas->getPort(),
                $this->cas->getUrl()
            );
        }
        phpCAS::setLang($this->cas->getLanguage());

        if ($this->cas->isRedirectingAfterLogout()) {
            $uri = $this->router->generate(
                $this->cas->getRouteLogout(),
                [],
                UrlGeneratorInterface::ABSOLUTE_URL
            );
            phpCAS::logoutWithRedirectService($uri);
        } else {
            //simple logout
            phpCAS::logout();
        }
    }
public function onLogoutSuccess ( Request $ request ) { phpCAS :: setDebug ( $ this -> cas -> getDebug ( ) ) ; phpCAS :: setVerbose ( $ this -> cas -> isVerbose ( ) ) ; if ( ! phpCAS :: isInitialized ( ) ) { phpCAS :: client ( $ this -> cas -> getVersion ( ) , $ this -> cas -> getHostname ( ) , $ this -> cas -> getPort ( ) , $ this -> cas -> getUrl ( ) ) ; } phpCAS :: setLang ( $ this -> cas -> getLanguage ( ) ) ; if ( $ this -> cas -> isRedirectingAfterLogout ( ) ) { $ uri = $ this -> router -> generate ( $ this -> cas -> getRouteLogout ( ) , [ ] , UrlGeneratorInterface :: ABSOLUTE_URL ) ; phpCAS :: logoutWithRedirectService ( $ uri ) ; } else { //simple logout phpCAS :: logout ( ) ; } }
Logout and redirect to home page.

@param Request $request
Logout and redirect to home page .