d.lanza38
d.lanza38

Reputation: 2627

How to make XDEBUG only trigger when XDEBUG_SESSION_START is set to a specific value?

Is there a way to cause XDEBUG to trigger only when a parameter (via Session, Cookie, Get, etc.) is passed with a particular value?

I was previously under the assumption that XDEBUG would only trigger when the value of the XDEBUG.IDEKEY (in my .ini file) setting was passed as either:

XDEBUG_SESSION=<idekey value> or XDEBUG_SESSION_START=<idekey value>

But now I'm noticing XDEBUG is triggered when XDEBUG_SESSION or XDEBUG_SESSION_START is just set, regardless of what the value is. It seems like the value can be anything.

I'd like to have it configured so an XDEBUG session will only be attempted if the end user uses a specific value (and my IDE is set to accept it). If the value is incorrect, then no XDEBUG session should be started.

Upvotes: 1

Views: 2476

Answers (1)

Derick
Derick

Reputation: 36784

Unlike for the profiler, or tracer, there is currently no way for the debugger to only get triggered on a specific value.

Xdebug doesn't generally care about the IDEKEY, unless proxies are involved.

Upvotes: 5

Related Questions