Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Miroslav Kratochvil
jekyll-theme-lcsb-default
Commits
1091d3ae
Verified
Commit
1091d3ae
authored
Apr 20, 2020
by
Laurent Heirendt
✈
Browse files
leave out domain for cookie
parent
48297cda
Changes
1
Hide whitespace changes
Inline
Side-by-side
assets/js/gdpr.js
View file @
1091d3ae
...
...
@@ -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
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment