TapCub is live — analytics, insights and live chat, free on one platform
Glossary

What are first-party cookies? Uses, limits and consent

A first-party cookie is set by the site in the address bar. What they are used for, why Safari still limits some of them, which ones usually need consent, and how analytics can work without them.

Ethan Brooks Reviewed by Chen Yu Also called 1st party cookie Last updated Nov 4, 2026 Glossary

Quick answer

A first-party cookie is a cookie set by the website shown in the address bar, either by its server or by a script running on its pages. It is used for logins, carts, preferences and first-party analytics, and is sent only to that site.

What is a first-party cookie?

A first-party cookie is set by the site you are on, the one in the address bar. The server can set it in a response header, or a script on the page can write it. Only that site can read it back.

Sample first-party cookies by purpose

On a sample store, shop.example.com:

CookiePurposeTypically needs consent?
session_idKeeps you logged inNo, strictly necessary
cartRemembers the basketNo, strictly necessary
langRemembers languageUsually no
_analytics_idRecognises returning visitorsOften yes, depending on region
_ad_clickStores an ad click ID for attributionOften yes

Being first-party says who sets the cookie, not what it is for. Consent rules follow the purpose. This is not legal advice.

First-party, but still limited

  • Safari caps cookies created by JavaScript at 7 days, so a client-side analytics ID can reset after a week without a visit.
  • Tracking protection may remove first-party cookies used for cross-site tracking via redirects.
  • People clear them, and private windows start empty.

Server-set cookies on your own domain last longer, but the consent question stays the same.

Analytics without cookies

Counting visitors does not need a cookie at all. TapCub's website script writes no cookie and no local storage; the visitor ID is computed on the server. The trade-off is that the same person on a new network or browser counts as a new visitor. See cookieless analytics and third-party cookies.

Was this explanation clear?

We use your answers to fix and expand this page.

Ethan Brooks

Solutions Engineer

Covers SDKs, API integrations, and data implementation, with an emphasis on validation, system interoperability, and troubleshooting.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is the difference between first-party and third-party cookies?

A first-party cookie belongs to the site you are visiting; a third-party cookie belongs to another domain embedded in the page. Only third-party cookies can follow a browser across unrelated sites.

Do first-party cookies need consent?

Strictly necessary ones (login, cart, security) usually do not. Analytics and advertising cookies often do, depending on the region. This is not legal advice.

How long do first-party cookies last?

As long as the expiry the site sets, but Safari limits cookies created by JavaScript to 7 days, so client-side analytics IDs reset more often there.

Are first-party cookies safe from blocking?

Mostly, but tracking protection can still shorten or remove those it treats as tracking, and users can clear them.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics