Skip to content

Instantly share code, notes, and snippets.

@jnonon
Created October 28, 2015 15:25
Show Gist options
  • Save jnonon/be8deaa904596a102c75 to your computer and use it in GitHub Desktop.
Save jnonon/be8deaa904596a102c75 to your computer and use it in GitHub Desktop.
Setting XDebug session ID
function setXdebugSessionCookie(sessionId) {
var now = new Date();
var time = now.getTime();
var expireTime = time + 1000*36000;
now.setTime(expireTime);
document.cookie = 'XDEBUG_SESSION='+sessionId+';expires='+now.toGMTString()+';path=/';
console.log(document.cookie);
}
//Use: Assuming your session id for XDebug is 12345, then setting the cookie setXdebugSessionCookie(12345) will allow to debug AJAX calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment