Last active
January 24, 2016 15:56
-
-
Save Erliz/2c391b9e0faa10addc4d to your computer and use it in GitHub Desktop.
startXDebug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setCookie(name, value, options) { | |
options = options || {}; | |
var expires = options.expires; | |
if (typeof expires == "number" && expires) { | |
var d = new Date(); | |
d.setTime(d.getTime() + expires * 1000); | |
expires = options.expires = d; | |
} | |
if (expires && expires.toUTCString) { | |
options.expires = expires.toUTCString(); | |
} | |
value = encodeURIComponent(value); | |
var updatedCookie = name + "=" + value; | |
for (var propName in options) { | |
updatedCookie += "; " + propName; | |
var propValue = options[propName]; | |
if (propValue !== true) { | |
updatedCookie += "=" + propValue; | |
} | |
} | |
document.cookie = updatedCookie; | |
} | |
function deleteCookie(name) { | |
setCookie(name, "", { | |
expires: -1 | |
}) | |
} | |
setCookie("XDEBUG_SESSION", "true"); | |
//deleteCookie("XDEBUG_SESSION"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment