diff --git a/src/mibew/js/source/chat_popup.js b/src/mibew/js/source/chat_popup.js index 891756d5..4b3aa306 100644 --- a/src/mibew/js/source/chat_popup.js +++ b/src/mibew/js/source/chat_popup.js @@ -57,11 +57,14 @@ var Mibew = Mibew || {}; * omitted a session cookie will be created. */ Mibew.Utils.createCookie = function(name, value, expires) { - var domain = /([^\.]+\.[^\.]+)$/.exec(document.location.hostname); - document.cookie = "" + name + "=" + value + "; " - + "path=/; " - + (domain ? ("domain=" + domain[1] + "; ") : '') - + (expires ? ('expires=' + expires.toUTCString() + '; ') : ''); + if (navigator.cookieEnabled) { + var domain = /([^\.]+\.[^\.]+)$/.exec(document.location.hostname); + document.cookie = "" + name + "=" + value + "; " + + "path=/; " + + (document.location.protocol == 'https:' ? "SameSite=None; secure; " : '') + + (domain ? ("domain=" + domain[1] + "; ") : '') + + (expires ? ('expires=' + expires.toUTCString() + '; ') : ''); + } }; /**