Identity & Recognition

Server-Side Cookie

A server-side cookie, also called a server-set cookie, is written by a web server in an HTTP response rather than by JavaScript on the page. It's still stored in the visitor's browser, but it often lasts longer because browser limits such as Safari's 7-day script cap don't cover it.

October 31, 2026

A server-side cookie, also called a server-set cookie, is written by a web server in an HTTP response rather than by JavaScript on the page. It's still stored in the visitor's browser, but it often lasts longer because limits such as Safari's 7-day script cap don't cover it.

How does it differ from a script-set cookie?

The browser holds both kinds. The difference is which part of the site wrote the cookie, and browsers treat the two differently.

Script-set cookie Server-side cookie
Written by JavaScript on the page The server, in an HTTP response
Safari's 7-day rule Covered Not covered by the script rule, with exceptions below
Brave 7-day cap 6-month maximum
Chrome Up to 400 days Up to 400 days
Crosses devices No No

The Brave and Chrome figures come from Klaviyo's cookie documentation.

Why do people use them?

  • Longer recognition in Safari. A customer who reorders every six weeks can outlast a script-set cookie and still be recognized through a server-set one.
  • Restoring other cookies. Klaviyo's First-Party ID, __kle_id, is server-set and restores __kla_id when Safari has removed it, for people with an existing profile.

What are the exceptions?

  • Safari and cross-site subdomains. Klaviyo's docs say the 7-day cap applies when a subdomain points to a cross-site host. WebKit covers the related practice of CNAME cloaking.
  • Safari and IP mismatches. Safari 16.4 can cap server-set cookies at 7 days when the setting server's IP doesn't match the site's first half, according to an Aimerce write-up. Elevar's docs carry a similar caveat.
  • One browser only. A shopper who starts on a laptop and opens your email on a phone has no cookie on the phone. See cross-device cart abandonment.
  • Consent still applies. How the cookie was written doesn't change your obligations under your store's banner.
  • Identity must exist first. Klaviyo's First-Party ID identifies only people with an existing profile, so it won't name a stranger.

How do you recognize customers when cookies go away?

Think of a cookie as one route to recognition. A browser can lose it at any time, and a customer may be on a new device anyway. Practical recognition combines a few things: an identifier that survives on the browser where possible, a moment where the person identifies themselves such as an email click or login, and a record of who they are that lives outside the browser. Returning customer recognition covers the idea, and our longer piece on server-side cookies goes further.

If you run Klaviyo, turn on Extended ID first, since it's on all plans, as explained in Extended ID vs First-Party ID.

Where does reOtter fit?

reOtter recognizes people who've already given your brand their details, without a third-party network, in a record that doesn't depend on a browser cookie surviving. Strangers aren't identified, and there's no shared identity network. On a returning customer's cart page, that recognition lets the page restore a held cart when reOtter knows who clicked.

Key takeaways

  • A server-side cookie is written in an HTTP response and stored in the browser, and it often outlasts a script-set cookie.
  • Safari can still cap it at 7 days in some setups, and Brave limits it to 6 months.
  • It helps recognition on the same device over time, and it can't carry anyone or any cart to a second device.

See how reOtter restores the cart → Abandoned cart recovery

Frequently asked questions

How long do server-side cookies last?
It varies by browser and setup. Chrome allows up to 400 days, and Brave caps server-set cookies at 6 months, according to Klaviyo's docs. Safari usually leaves them outside its 7-day script cap, with exceptions for cross-site subdomains and IP mismatches.
Are server-side cookies stored on the server?
No. The name refers to who wrote the cookie. The server sends it in the HTTP response and the browser stores it like any other cookie. That's why it stays on one browser and one device.
Do server-side cookies help with cross-device tracking?
No. A cookie never crosses devices, however it was set. Recognizing someone on a new device takes an email click or a store login, and restoring their cart also needs that cart saved on a server.
Do server-side cookies get around cookie consent?
They shouldn't. The way a cookie gets written doesn't change what your banner and privacy rules require. Treat a server-set cookie like any other.
Does Klaviyo use server-side cookies?
Klaviyo offers one. Its First-Party ID, `__kle_id`, is server-set and can restore the script-set `__kla_id` cookie for people with an existing profile. Its documentation notes that Safari's 7-day cap can apply when a subdomain points to a cross-site host.

Keep exploring

Cart Recovery

Server-Side Cookies: What They Do for Returning Customers and Where They Stop

Server-side cookies last longer than script-set ones in most browsers, which is why so many ecommerce tools now use them. They also have exceptions worth knowing. Here's how they work, where they stop, and what to do about recognizing returning customers when browser cookies go away.

Cart Recovery

The Safari 7-Day Cookie Limit, Explained for Klaviyo Brands

Safari can delete JavaScript-set cookies after 7 days of browser use without interaction with your site. Here's how that affects Klaviyo's tracking cookie, what Extended ID and First-Party ID change, and the one thing no cookie setting can fix.

Identity & Recognition

First-Party Cookie

A first-party cookie is a small piece of data stored in the browser for the domain the visitor is on. Stores use them for carts, logins and recognizing returning visitors. How long one lasts depends on the browser and on whether a script or a server set it.

Identity & Recognition

Safari ITP

Safari ITP, or Intelligent Tracking Prevention, is Apple's set of browser limits on tracking. The one ecommerce teams meet most often deletes script-writable storage, including JavaScript-set cookies, after 7 days of Safari use without interaction with the site.

Identity & Recognition

Returning Customer Recognition

Returning customer recognition means knowing that a visitor is someone who has already given your brand their details, so the site can treat them accordingly. It relies on first-party signs such as logins, email clicks and stored identifiers, and it differs from naming strangers through an identity network.

Identity & Recognition

Device Recognition

Device recognition means knowing that a browser or device has visited your site before, usually through a stored identifier such as a cookie. It tells you about the device and not necessarily the person, so shared devices and second devices both need separate handling.