Przejdź do głównej zawartości

Function: getCookie()

getCookie(name): string | null

Get cookie value by name (client-side only).

A malformed percent-encoding (e.g. % or %zz) makes decodeURIComponent throw a URIError. Since this runs on every request (the cart secret getter reads the cart cookie here), a corrupt cookie value is treated as absent — returns null rather than throwing, so the caller can fall back to recreating the cookie instead of breaking the whole request pipeline.

Parameters

name

string

Returns

string | null