Przejdź do głównej zawartości

Variable: CART_COOKIE_NAME

const CART_COOKIE_NAME: "cart-id" = 'cart-id'

Cart cookie configuration — platform contract.

Used by:

  • SDK cart store (client-side cookie read/write)
  • Server-side cart prefetching (SSR cart badge, middleware)
  • proxy.ts (edge cart ID detection)

The cookie value is composite: <cartId>.<secret>. The cart id is a UUID and the secret is base64url — neither contains a dot, so the first dot separates the two halves. A legacy plain <cartId> value (written before the cart carried a secret) parses with cartSecret: null; the client then operates without the x-cart-secret header and the backend treats the cart as unreachable, so the SDK recreates a fresh one.