> For the complete documentation index, see [llms.txt](https://docs.does.qa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.does.qa/test-steps/data/set-cookie.md).

# Set Cookie

Set Cookie writes a named cookie into the browser. Use it to seed session state, consent flags, or test data before the application reads cookies on the next request.

![Set cookie Test Step](https://app.does.qa/screenshots/node/data_cookie_set.png)

## When to use it

* Preload an authentication or session cookie before opening a protected page.
* Set a consent or preference cookie so the UI skips a banner.
* Pair with [Check Cookie](/test-steps/check/check-cookie.md) or [Store Cookie](/test-steps/data/store-cookie.md) to confirm or reuse the value later.

## Configure

### Basics

| Field            | What to set                                            |
| ---------------- | ------------------------------------------------------ |
| **Cookie Name**  | Name of the cookie to write                            |
| **Cookie Value** | Value as text and/or a [Value](/values/value-store.md) |

### Advanced

| Field              | What to set                                                    |
| ------------------ | -------------------------------------------------------------- |
| **Domain**         | Cookie domain as text and/or a [Value](/values/value-store.md) |
| **Expiry**         | Expiry as text and/or a [Value](/values/value-store.md)        |
| **HTTP Only**      | `true` or `false` (default)                                    |
| **Path**           | Cookie path as text and/or a [Value](/values/value-store.md)   |
| **Same Site**      | `None`, `Lax` (default), or `Strict`                           |
| **Secure**         | `true` or `false` (default)                                    |
| **Status on fail** | [Failed Status](/test-step-options/failed-status.md)           |

## Related

* [Store Cookie](/test-steps/data/store-cookie.md)
* [Delete Cookie](/test-steps/data/delete-cookie.md)
* [Check Cookie](/test-steps/check/check-cookie.md)
* [Data](/test-steps/data.md)

**Tags:** `data`, `cookie`, `set`, `save`, `add`
