Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove XDEBUG_SESSION cookie while performing XHRs #28

Closed
wants to merge 1 commit into from

Conversation

adrolter
Copy link
Contributor

@adrolter adrolter commented Dec 8, 2023

When using an Xdebug browser extension with Symfony, toolbar requests are also processed by Xdebug because the browser extension has set the XDEBUG_SESSION cookie on the page. This leads to superfluous breakpoint triggering when debugging at lower levels of the codebase, as well as a performance hit with no gain for every toolbar request.

The only sane way to prevent this behavior seems to be for the cookie to never be sent, as Xdebug has no mechanism for ignoring requests to certain URIs, and detecting this condition at the webserver and rewriting the request before passing it off to PHP is also non-trivial.

This PR detects the XDEBUG_SESSION cookie and removes it before conducting XHR, then re-sets it after the fact.

Thanks!

Copy link

github-actions bot commented Dec 8, 2023

Thanks for your pull request! We love contributions.

However, you should instead open a pull request on the main repository:

https://github.com/symfony/symfony

This repository is what we call a "subtree split": a read-only subset of that main repository.

We're looking forward to your PR there!

@github-actions github-actions bot closed this Dec 8, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant