1

Get cookie by name

Function JavaScript 1 revisions 153 a year ago a year ago
function getCookie(name) {
	var value = '; ' + document.cookie;
	var parts = value.split('; ' + name + '=');
	if (parts.length == 2) return parts.pop().split(';').shift();
}

This function gets uh, cookie, by name.

getCookie('token'); // "oopsileakedmyaccesstoken"