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 cookies for selfhosted

Blue Mouse20f73c1cc0c6
diff --git a/src/utils/cookie.ts b/src/utils/cookie.ts
index fbde215a7..35e9a653c 100644
--- a/src/utils/cookie.ts
+++ b/src/utils/cookie.ts
@@ -1,10 +1,8 @@
-import { isDevelopment } from 'redux/constants'
+import { isDevelopment, isSelfhosted } from 'redux/constants'
const COOKIE_DOMAIN = 'swetrix.com'
-const COOKIE_SUFFIX = isDevelopment ? '' : `; domain=${COOKIE_DOMAIN}; secure`
-
-// const COOKIE_SUFFIX = '; domain=swetrix.com; secure'
+const COOKIE_SUFFIX = (isDevelopment || isSelfhosted) ? '' : `; domain=${COOKIE_DOMAIN}; secure`
export const getCookie = (key: string) => {
const match = document.cookie.match(new RegExp(`(^| )${key}=([^;]+)`))