Using xdebug with a front-end js SPA?
Couple of possible approaches outside of using COOKIE or GET/POST parameter.
Use
xdebug.remote_autostart = 1
in your php.ini. This option instructs Xdebug to attempt to debug every single request (regardless of cookies or GET/POST parameters).Do not forget to restart you web server / PHP so that it will read you new config file.
Downside: will attempt to debug every single request, even if no debugging is required, so you may see approx 1 sec delay while Xdebug is trying to establish a debug connection.
Place
xdebug_break();
in the actual PHP code: a programmatic breakpoint that will initiate debug session if not yet established and will stop at that line.Downside: need to edit PHP code for that.