Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fixed buggy auth between swetrix and marketplac

Blue Mouse0a2d63dc6c00
diff --git a/src/utils/cookie.js b/src/utils/cookie.js
index c373f62bb..59dad2eaa 100644
--- a/src/utils/cookie.js
+++ b/src/utils/cookie.js
@@ -1,3 +1,5 @@
+const COOKIE_DOMAIN = 'swetrix.com'
+
export const getCookie = key => {
const match = document.cookie.match(new RegExp(`(^| )${key}=([^;]+)`))
@@ -9,5 +11,5 @@ export const getCookie = key => {
}
export const setCookie = (key, value, maxAge = 3600, sameSite = 'strict') => {
- document.cookie = `${key}=${value}; max-age=${maxAge}; path=/; SameSite=${sameSite}`
+ document.cookie = `${key}=${value}; max-age=${maxAge}; path=/; domain=${COOKIE_DOMAIN} SameSite=${sameSite}; secure`
}