diff --git a/Build/Scripts/annotationChecker.php b/Build/Scripts/annotationChecker.php
index d8321c0e5a30216a201ef9fa438b1f8389584d66..313db37f3b1265b8091f900dd8cd4bc325b88262 100755
--- a/Build/Scripts/annotationChecker.php
+++ b/Build/Scripts/annotationChecker.php
@@ -57,7 +57,7 @@ class NodeVisitor extends NodeVisitorAbstract
                     // PHPDocumentor 2 tags
                     'api', 'author', 'category', 'copyright', 'deprecated', 'example', 'filesource', 'global', 'ignore', 'internal', 'license', 'link', 'method', 'package', 'param', 'property', 'property-read', 'property-write', 'return', 'see', 'since', 'source', 'subpackage', 'throws', 'todo', 'TODO', 'usedby', 'uses', 'var', 'version',
                     // PHPUnit tags
-                    'codeCoverageIgnore', 'codeCoverageIgnoreStart', 'codeCoverageIgnoreEnd', 'test', 'covers', 'dataProvider', 'group', 'skip', 'depends', 'expectedException', 'before', 'requires',
+                    'codeCoverageIgnore', 'codeCoverageIgnoreStart', 'codeCoverageIgnoreEnd', 'test', 'covers', 'dataProvider', 'group', 'skip', 'depends', 'expectedException', 'before', 'requires', 'runInSeparateProcess',
                     // codeception tags
                     'env',
                     // PHPCheckStyle
diff --git a/typo3/sysext/core/Classes/Http/AbstractApplication.php b/typo3/sysext/core/Classes/Http/AbstractApplication.php
index 66627a75dbb8be0f7a72160678ea1bdcf8158c3a..788bedddd8aaa20546fcd3d7b5afcfe236503775 100644
--- a/typo3/sysext/core/Classes/Http/AbstractApplication.php
+++ b/typo3/sysext/core/Classes/Http/AbstractApplication.php
@@ -26,6 +26,10 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  */
 abstract class AbstractApplication implements ApplicationInterface
 {
+    private const MULTI_LINE_HEADERS = [
+        'set-cookie',
+    ];
+
     /**
      * @var string
      */
@@ -74,7 +78,13 @@ abstract class AbstractApplication implements ApplicationInterface
             }
 
             foreach ($response->getHeaders() as $name => $values) {
-                header($name . ': ' . implode(', ', $values));
+                if (in_array(strtolower($name), self::MULTI_LINE_HEADERS, true)) {
+                    foreach ($values as $value) {
+                        header($name . ': ' . $value, false);
+                    }
+                } else {
+                    header($name . ': ' . implode(', ', $values));
+                }
             }
         }
         $body = $response->getBody();
diff --git a/typo3/sysext/core/Tests/Unit/Http/AbstractApplicationTest.php b/typo3/sysext/core/Tests/Unit/Http/AbstractApplicationTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..a99b0fe9a3ac85358c00fe88186e7da85aba078c
--- /dev/null
+++ b/typo3/sysext/core/Tests/Unit/Http/AbstractApplicationTest.php
@@ -0,0 +1,42 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Unit\Http;
+
+use Psr\Http\Message\ResponseInterface;
+use TYPO3\CMS\Core\Http\AbstractApplication;
+use TYPO3\CMS\Core\Http\Response;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
+
+class AbstractApplicationTest extends UnitTestCase
+{
+    /**
+     * @runInSeparateProcess
+     */
+    public function testCookiesAreSentAsMultipleHeaders()
+    {
+        if (!extension_loaded('xdebug')) {
+            $this->markTestSkipped('This test can only be executed if xdebug is present.');
+        }
+
+        $application = new class extends AbstractApplication {
+            public function sendResponse(ResponseInterface $response)
+            {
+                parent::sendResponse($response);
+            }
+        };
+
+        $response = (new Response())
+            ->withStatus(204)
+            ->withAddedHeader('Cache-Control', 'public')
+            ->withAddedHeader('Cache-Control', 'max-age=3600')
+            ->withAddedHeader('Set-Cookie', 'foo=bar')
+            ->withAddedHeader('Set-Cookie', 'baz=foobar');
+
+        $application->sendResponse($response);
+
+        $this->assertSame([
+            'Cache-Control: public, max-age=3600',
+            'Set-Cookie: foo=bar',
+            'Set-Cookie: baz=foobar',
+        ], xdebug_get_headers());
+    }
+}