mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
Update script
This commit is contained in:
parent
a315e1c86c
commit
2049d43e34
@ -10,18 +10,14 @@
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (3*365*24*60*60*1000)); // 3 YEARS
|
||||
var expires = "; expires=" + date.toUTCString();
|
||||
document.cookie = name + "=" + (value || "") + expires + "; path=/";
|
||||
document.cookie = name + "=" + (value || "") + expires + "; samesite=strict; path=/";
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for(var i=0;i < ca.length;i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
||||
}
|
||||
return null;
|
||||
let matches = document.cookie.match(new RegExp(
|
||||
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
||||
));
|
||||
return matches ? decodeURIComponent(matches[1]) : null;
|
||||
}
|
||||
|
||||
function pseudoUUIDv4() {
|
||||
|
Loading…
Reference in New Issue
Block a user