Browsers and other macOS applications use the NSHTTPCookieStorage API to store cookies. The API writes .binarycookies files in a specialized binary format. The binary file format has the following structure:
| Bytes | Format | Description |
|---|---|---|
| 4 | text | magic number ('cook') |
| 4 | uint32 BE | page count (np) |
| *4 [i] | uint32 BE | page i data size S, bytes; *repeat np times |
| *S [i] | bytes | page i contents; *repeat np times |