---
title: Cookie Request
description: "Configuration 0x00, server → client."
---

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

Asks the client for a stored cookie by key during configuration. The client must reply with `CookieResponse`, with an empty payload if it has no such cookie.

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

## Fields

| Field | Type | Notes |
|---|---|---|
| `cookie` | String | also `key` |

## Send it

```ts
// Server side, request a previously stored cookie.
await client.sendPacket("CookieRequest", {
  cookie: "example:session",
});
```

The key must be a namespaced identifier. The client answers with `CookieResponse` using the same key and either the stored bytes or `null`; `key` is accepted as an alias for `cookie`.

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

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