Verified Commit 1091d3ae authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

leave out domain for cookie

parent 48297cda
......@@ -59,15 +59,17 @@ function hideBanner() {
* clearCookies: clear all cookies
*/
function clearCookies() {
var originOfTime = new Date(0);
var hostname = document.location.hostname.replace(/^www\./, ''),
commonSuffix = '; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/';
commonSuffix = '; expires= ' + originOfTime + '; path=/';
// remove the analytics cookies
var cookies = document.cookie.split('; ');
for (var i in cookies) {
var name = cookies[i].split('=')[0];
if (name.startsWith('_pk_')) {
document.cookie = name + '=; domain=.' + hostname + commonSuffix;
console.log(name);
document.cookie = name + '=; ' + commonSuffix;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment