protected function buildLogout()
    {
        //Deletes some cookies and KCFinder session
        $cookies = $this->request->getCookieCollection()->remove('login')->remove('sidebar-lastmenu');
        $this->request = $this->request->withCookieCollection($cookies);
        $this->request->getSession()->delete('KCFINDER');

        return $this->redirect($this->Auth->logout());
    }