I want to get the value stored in a cookie on my site. From "document.cookie", I get the following string :
startBAK=R3415751377; _ga=GA1.2.1180519210.1552400330; _gid=GA1.2.1693387126.1552400330; trkPV=4; ata=google.com;
I want to extract the value of ata "google.com" So I tried this :
var cookie = document.cookie;
var regex = /(?:ata=)(.*?);/g;
var value = cookie.match(regex);
return value
The result is "ata=google.com".... how can i get the value only : "google.com" ?