function Cookieclass(name, val, days, path, domena, secure) { this.name = encodeURIComponent(name); this.val = encodeURIComponent(val); this.days = days; this.path = path; this.domena = domena; this.secure = secure; this.makecookie = function () { var cookieText = this.name + "=" + this.val; if (typeof this.days === "number") { const data = new Date(); data.setTime(data.getTime() + (this.days * 24*60*60*1000)); cookieText += "; expires=" + data.toGMTString(); } if (this.path) { cookieText += "; path=" + this.path; } if (this.domena) { cookieText += "; domain=" + this.domena; } if (this.secure) { cookieText += "; secure"; } document.cookie = cookieText; } this.showcookie = function () { if (document.cookie != "") { const cookies = document.cookie.split(/; */); for (var i=0; i