Skip to content

Fix RuntimeException in LoginCallbackController

Mykhailo Denysiuk requested to merge feature/3196456-runtime-exception into 2.0.x

Problem/Motivation

/Drupal\o365_sso\Controller\LoginCallbackController->callback RuntimeException: Failed to start the session because headers have already been sent by "/app/vendor/symfony/http-foundation/Response.php" at line 377. in /app/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php on line 150 #0 /app/html/core/lib/Drupal/Core/Session/SessionManager.php(164):

Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() #1 /app/html/core/lib/Drupal/Core/Session/SessionManager.php(118): Drupal\Core\Session\SessionManager->startNow() #2 /app/vendor/symfony/http-foundation/Session/Session.php(57): Drupal\Core\Session\SessionManager->start() #3 /app/html/core/modules/big_pipe/src/Render/BigPipe.php(240): Symfony\Component\HttpFoundation\Session\Session->start() #4 /app/html/core/modules/big_pipe/src/Render/BigPipe.php(295): Drupal\big_pipe\Render\BigPipe->performPreSendTasks() #5 /app/html/core/modules/big_pipe/src/Render/BigPipeResponse.php(112): Drupal\big_pipe\Render\BigPipe->sendContent(Object(Drupal\big_pipe\Render\BigPipeResponse)) #6 /app/vendor/symfony/http-foundation/Response.php(374): Drupal\big_pipe\Render\BigPipeResponse->sendContent() #7 /app/html/index.php(20): Symfony\Component\HttpFoundation\Response->send()

Steps to reproduce

Do login via o365 SSO.

Proposed resolution

Return Redirect Response objects in Controllers instead of execution send() method.

Merge request reports