Skip to content

Commit a82c499

Browse files
author
Karsten Nilsen
committed
[FrankenPHP] Check for XDEBUG_SESSION cookie before connecting to debugger
Only connect to the Xdebug client when the XDEBUG_SESSION cookie is set. This replicates the behavior in non-worker environments where the debugger only activates when explicitly enabled through the debug toolbar.
1 parent 182563a commit a82c499

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/frankenphp-symfony/src/Runner.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public function run(): int
3333
$server['APP_RUNTIME_MODE'] = 'web=1&worker=1';
3434

3535
$handler = function () use ($server, &$sfRequest, &$sfResponse, $xdebugConnectToClient): void {
36-
// Connect to the Xdebug client if it's available
37-
if ($xdebugConnectToClient) {
36+
// Connect to the Xdebug client if it's available and the XDEBUG_SESSION cookie is set
37+
if ($xdebugConnectToClient && isset($_COOKIE['XDEBUG_SESSION'])) {
3838
xdebug_connect_to_client();
3939
}
4040

0 commit comments

Comments
 (0)