Skip to content

Encoding

The same value written with 'uri' and 'minimal' encoding. The middle column is what the browser stores and what a server receives in the Cookie header. Try a value with spaces or ; to see 'minimal' fall back to URL encoding.

Live demo

The demo creates a child injector for each encoding so both can run on one page. In an app, add provideCookieEncoding() once to app.config.ts. See Value encoding.

A CookieCodec that stores values as URL-safe base64.

Live demo