Skip to content

Managing Cookies Using the HTTP Client

Overview

The Cookie Manager in Martini's HTTP Client gives you full control over persistent cookies tied to specific domains. Unlike per-request cookies defined in the Cookies tab, Cookie Manager cookies survive across sessions — they remain stored even after you close and reopen Martini Designer. This makes the Cookie Manager the right tool for maintaining authentication tokens, session identifiers, and any other state that needs to persist between test runs.

What You Will Learn

  • How to open and navigate the Cookie Manager interface
  • How to add, edit, and delete domains in the Cookie Manager
  • How to add, remove, and disable cookies for a domain
  • How cookie precedence works when both the Cookie Manager and Cookies tab define the same cookie

When To Use This

Use the Cookie Manager when you need to:

  • Persist session or authentication cookies across multiple HTTP requests without re-entering them each time
  • Test endpoints that depend on cookies set by a previous server response
  • Override or supplement server-set cookies during API development and debugging
  • Manage cookies for multiple domains from a single, centralized location
  • Disable specific cookies temporarily to test how an endpoint behaves without them

Prerequisites

Before using the Cookie Manager, ensure the following are in place:

The Cookie Manager is a persistent storage interface built into the HTTP Client that organizes cookies by domain. It automatically captures cookies returned by servers and lets you create, modify, and delete cookies manually.

To open the Cookie Manager:

  1. Open the HTTP Client view.
  2. In the HTTP Client toolbar, click the Cookie Manager button.

You can also open it from within an open HTTP request:

  1. Select the Cookies tab.
  2. Click the Cookie Manager button.

Or from the Response panel after receiving a response:

  1. Select the Cookies tab in the Response panel.
  2. Click the Cookie Manager button.

Expected result: The Cookie Manager opens, displaying a search bar, a Domain panel on the left, and a Cookie table on the right.

The Cookie Manager integrates with every HTTP request you send from the HTTP Client. Understanding how it processes cookies helps you predict which values are sent with each request.

Automatic cookie capture: When a server response includes Set-Cookie headers, the Cookie Manager automatically stores those cookies under the corresponding domain. This happens without any manual action on your part.

Cookie matching on send: When you send an HTTP request, Martini evaluates the Cookie Manager for any stored cookies whose domain and path match the request URL. All matching cookies are automatically appended to the request.

Cookie precedence rule: If both the Cookie Manager and the Cookies tab contain a cookie with the same name, the cookie defined in the Cookies tab takes precedence and is the one sent with the request. The Cookie Manager entry is not sent for that name.

Session persistence: Cookie Manager entries are saved to disk. This means cookies persist across Martini Designer restarts, making them reliable for long-running development and testing workflows.

The Cookie Manager removes the friction of manually re-entering session and authentication cookies during API testing. By centralizing cookie storage per domain, it lets you maintain realistic request state across an entire test session.

Common scenarios where the Cookie Manager adds value:

  • Session-based API testing — Capture the session cookie from a login response and reuse it automatically across all subsequent requests to the same domain
  • Cookie override testing — Manually create cookies with specific expiry or path constraints to test how an API responds to edge-case cookie conditions
  • Regression testing — Disable individual cookies using the checkbox to verify that specific endpoints degrade gracefully when expected cookies are absent

Domains act as containers in the Cookie Manager — every cookie must belong to a domain. Managing domains correctly ensures that cookies are matched and sent only for the intended hosts.

To associate cookies with a new host, first add its domain:

  1. Open the Cookie Manager.
  2. In the toolbar on the right side of the Domain panel, click the Add button, or press + .
  3. A new editable entry appears in the Domain panel.
  4. Type the host name only — omit the scheme (https://), port (:8080), and query string. Example: enter api.example.com, not https://api.example.com:8080/api?token=abc.

Expected result: The domain appears in the Domain panel and is ready to receive cookie entries.

To rename an existing domain:

  1. Select the domain you want to rename in the Domain panel.
  2. Click the Edit button in the Domain toolbar, or press .
  3. Update the host name and confirm.

Expected result: The domain is renamed and all cookies previously associated with it remain intact under the new name.

To remove one or more domains and all their associated cookies:

  1. Select one or more domains in the Domain panel.
  2. Click the Delete button in the Domain toolbar, or press .

Expected result: The selected domains and all their cookies are permanently removed from the Cookie Manager.

Once a domain is registered, you can add, remove, search, and disable its cookies directly from the Cookie Manager. The Cookie table on the right side of the dialog displays all cookies for the currently selected domain.

Each cookie stored in the Cookie Manager has the following configurable fields.

Property Example Value What It Controls
Name session_id The identifier used to reference this cookie
Value abc123xyz The data stored in the cookie for the specified name
Path /api/v1 The URL path scope for which the cookie is valid; the cookie is only sent with requests matching this path
Expires At 2026-12-31 23:59:59 The date and time when the cookie expires and is no longer sent
HTTP Only Enabled / Disabled When enabled, restricts the cookie to HTTP requests only
Secure Enabled / Disabled When enabled, sends the cookie only over encrypted HTTPS connections

To create a new cookie for a specific domain:

  1. Select the target domain in the Domain panel.
  2. In the toolbar on the right side of the Cookie table, click the Add button, or press + .
  3. A new row appears in the Cookie table. Fill in the fields as described in the Cookie Fields Reference above.

Expected result: The new cookie row is saved to the Cookie Manager and will be sent automatically with matching requests.

To delete one or more cookies from a domain:

  1. Select the domain in the Domain panel.
  2. In the Cookie table, select one or more cookie rows to remove.
  3. Click the Delete button in the Cookie toolbar, or press .

Expected result: The selected cookies are permanently removed from the Cookie Manager and will no longer be sent with requests.

To prevent a cookie from being sent without removing it:

  1. Select the domain in the Domain panel.
  2. Locate the cookie in the Cookie table.
  3. Uncheck the checkbox to the left of the cookie's name.

Expected result: The cookie remains stored in the Cookie Manager but is excluded from all outgoing requests until you re-enable it by checking the checkbox again.

Searching Cookies and Domains

The search bar at the top of the Cookie Manager filters both domain names and cookie names in real time. Type any part of a domain name or cookie name and the Domain panel and Cookie table update immediately to show only matching entries. Clear the search field to restore the full list.

Problem Detection Cause Fix
Cookie is not sent with the request Server returns 401 or missing-session error Domain in Cookie Manager does not match the request host exactly Verify the domain entry contains only the host name with no scheme, port, or path
Cookie Manager cookie is ignored for a specific name Cookie Manager value is never sent; Cookies tab value is used instead A cookie with the same name exists in the Cookies tab, which takes precedence Remove or rename the conflicting entry in the Cookies tab if the Cookie Manager value should be used
Cookie disappears after setting an expiry date Cookie not sent on subsequent requests The Expires At value is set to a past date/time Update Expires At to a future date
Secure cookie not sent Request completes but cookie header is absent The request URL uses HTTP instead of HTTPS while the cookie has Secure enabled Either send the request over HTTPS or disable the Secure flag for local HTTP testing

Helpful Resources