I was also wondering if we can replace _$request->getBasePath()_ by _$request->getBaseUrl()_ as it lead to redirect to _/logout_ instead of _/appdev.php/logout_ when working with the dev front controller