How to keep debugging enabled across browser sessions?

I'm using XDebug to debug PHP scripts and have run into a problem. I'm using Internet Explorer at the moment to debug a problem with a login script and when I close the browser and reopen it, the XDEBUG cookie is no longer set. This is a problem because since I'm debugging a login script that runs when the page opens, I need breakpoints to trigger when the browser is opened (I can't open the browser and then click the bookmarklet because by that time the script has already run).

Is there any way to keep the cookie set across browser sessions (i.e. after closing and reopening IE)?

2 comments

Hi there,

Set xdebug.remote_autostart = 1 in your php.ini. This will tell xdebug to attempt to debug every single request regardless of xdebug cookie presence.

Note: If debugging client is not available (IDE is closed or not listening for debug connections) you will see around 1 sec delay in execution while xdebug attempts to establish debug connection.

---

As for cookies-only approach -- edit cookie in your browser manually and remove "this sesssion only" attribute (you can also extend expiration time, if desired). This will make cookie surviving that browser restarting.

0

Thank you SO MUCH for including this line:

Note: If debugging client is not available (IDE is closed or not listening for debug connections) you will see around 1 sec delay in execution while xdebug attempts to establish debug connection.

I was banging my head against the wall trying to figure out why my site was loading so slowly and this was the problem!

0

Please sign in to leave a comment.