Redirect for anonymus user doesn´t work from Controller


i´ve got a simple COntroller for redirect my users by visiting a special path (localhost/drupal8/check). At the moment the redirect works for the administrator and for registrated user, if they are logged in, but not for the quests of my site (i know that it is only a local site).

namespace DrupaltestmoduleController; 
use DrupalCoreControllerControllerBase;

class EntityChecker extends ControllerBase {

  public function redirectToFront($bundle, $label) { return $this->redirect('<front>');


In the log i´m getting the following error:

[30-Jul-2018 09:30:25 UTC] RuntimeException: Failed to start the
session because headers have already been sent by
“C:wamp64wwwdrupal8vendorsymfonyhttp-foundationResponse.php” at
line 1274. in
on line 141 #0

Thanks a lot for helping me

قالب وردپرس