---
title: "Set a cookie"
method: POST
path: "/v1/browser/storage/cookie"
tags: ["Browser"]
---

# Set a cookie

`POST /v1/browser/storage/cookie`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/browser/storage/cookie`
- Auth: HTTP bearer

Sets a cookie on the attached page via CDP Network.setCookie.

## Request body

- object
  - `name` string, required
  - `value` string, required
  - `domain` string
  - `url` string
  - `path` string
  - `httpOnly` boolean
  - `secure` boolean
  - `sameSite` 'Strict' | 'Lax' | 'None'
  - `expires` number: Unix timestamp for cookie expiration

## Response `200`

Cookie set

- object
  - `success` true, required

## Other responses

- `400`: Invalid request
- `502`: CDP error
- `503`: Browser service not initialized

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
