GitHub 6248★

Get the value of a cookie

JavaScript version

const cookie = (name) => `; ${document.cookie}`.split(`; ${name}=`).pop().split(';').shift();

Examples

cookie('_ga'); // GA1.2.825309271.1581874719
Follow me on and to get more useful contents.