Skip to content

Commit

Permalink
cookieValue encoding from js-cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
aorcsik committed Feb 20, 2024
1 parent 10ff51d commit 285d116
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/js/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const expires = new Date();
expires.setMonth(expires.getMonth() + 12);
let domain = '.bitrise.io';
if (window.location.host.match('localhost')) domain = 'localhost';
document.cookie = `${cookieName}=${now};expires=${expires};domain=${domain};`;
const cookieValue = encodeURIComponent(String(now))
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
document.cookie = `${cookieName}=${cookieValue};expires=${expires};domain=${domain};`;

const url = new URL(document.location.href);
const queryLastVisit = url.searchParams.get("lastVisit");
Expand Down

0 comments on commit 285d116

Please sign in to comment.