alex72bel,
а почитать самому доку?
https://learn.javascript.ru/cookie
window.addEventListener("DOMContentLoaded", function() {
var d = document.querySelector("#parent_popup"),
e = document.querySelector(".close");
e.addEventListener("click", function(a) {
a.preventDefault();
d.classList.toggle("show");
})
function getCookie(name) {
var matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
!getCookie('rem') && window.setTimeout(function() {
var date = new Date(new Date().getTime() + 7 * 24 * 60 * 60 * 1000);
document.cookie = "rem=yes; path=/; expires=" + date.toUTCString();
d.classList.toggle("show");
window.setTimeout(function() {
d.classList.contains("show") && d.classList.toggle("show")
},5000) //open
},5000) //pause
});