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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | RuntimeException_in_LoginCallbackController-3196456-3.patch | 1.98 KB | al_trottier |
Comments
Comment #2
denysyukm@gmail.com commentedMerge request to review: https://git.drupalcode.org/project/o365/-/merge_requests/3
Comment #3
al_trottier commentedCreating a patch based on mdeny's proposed fix.
Comment #4
pvasener commentedThis MR fixed the problem for me.
Comment #5
nicholassThis also fixes the 3.0x branch but the patch from the merge request could not be applied. But when I apply it manually the error is fixed.
Comment #6
nicholassComment #7
nicholassComment #8
nicholassDrupal v9.3.2
0365 v3.0.4
Although the original error about session headers already being sent is gone, another error for me still exists.
Comment #11
fabianderijkThis has now been fixed (in a bit different way) for both the 2.0.x and 3.0.x branches. Releases 2.0.5 and 3.0.5 have been created for this.