---
title: Store Cookie
description: "Configuration 0x0A, server → client."
---

`config` · `0x0A` · **clientbound** (server → client)

Asks the client to store a cookie (key plus up to 5120 bytes of payload). The client keeps it for the current server and sends it back when a `CookieRequest` for that key arrives, including after a `Transfer`.

Sent by the server, read by the client. Listen for it with `client.on("StoreCookie", (data) => …)` on the receiving side.

## Fields

| Field | Type | Notes |
|---|---|---|
| `key` | String |  |
| `value` | Byte[] | also `payload` |

## Send it

```ts
await client.sendPacket("StoreCookie", {
  key: "example:session",
  value: Buffer.from("opaque session data"),
});
```

Cookie keys are namespaced identifiers and values may contain at most 5120 bytes. Treat the value as opaque bytes; `payload` is accepted as an alias for `value`.

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: [`src/Core/Versions/776/Packets/config/clientbound/StoreCookie.ts`](https://github.com/GDLev/mc-protocol/blob/master/src/Core/Versions/776/Packets/config/clientbound/StoreCookie.ts)
