Skip to content

Instantly share code, notes, and snippets.

@marcinantkiewicz
Last active May 15, 2020 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcinantkiewicz/0523500bf5a535e4ee833a41852c3b51 to your computer and use it in GitHub Desktop.
Save marcinantkiewicz/0523500bf5a535e4ee833a41852c3b51 to your computer and use it in GitHub Desktop.
//will miss cookies with httpOnly attribute set
function printCookie(match){
var cookies = document.cookie.split(";");
var cookie = {};
for (var i=0; i<cookies.length; i++){
header = cookies[i].trim();
marker = header.indexOf("=");
name = header.substr(0,marker);
value = header.substr(marker+1);
if (match == name) { console.log(name," = ",value);}
}
}
printCookie("AWSALB")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment