Commit 8d9744c5 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Make cookies permanent.

parent 237660c9
Pipeline #79918 passed with stages
in 48 minutes and 32 seconds
...@@ -154,6 +154,7 @@ function Consent() { ...@@ -154,6 +154,7 @@ function Consent() {
const [cookies, setCookie] = useCookies() const [cookies, setCookie] = useCookies()
const [accepted, setAccepted] = useState(cookies['terms-accepted']) const [accepted, setAccepted] = useState(cookies['terms-accepted'])
const [optOut, setOptOut] = useState(cookies['tracking-enabled'] === 'false') const [optOut, setOptOut] = useState(cookies['tracking-enabled'] === 'false')
const forever = new Date(2147483647 * 1000)
useEffect(() => { useEffect(() => {
if (!optOut) { if (!optOut) {
...@@ -165,8 +166,8 @@ function Consent() { ...@@ -165,8 +166,8 @@ function Consent() {
const handleClosed = accepted => { const handleClosed = accepted => {
if (accepted) { if (accepted) {
setCookie('terms-accepted', true) setCookie('terms-accepted', true, {expires: forever})
setCookie('tracking-enabled', !optOut) setCookie('tracking-enabled', !optOut, {expires: forever})
setAccepted(true) setAccepted(true)
} }
} }
......
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