HTTP Request Cookies
Overview
The Cookies tab in the HTTP Request Editor lets you attach named cookies to outgoing HTTP requests, sending session state or authentication data to the server alongside the main request payload. Use it to simulate authenticated sessions, test cookie-based processes, or replicate browser behavior when calling your APIs directly from Martini.
What You Will Learn
- How to add cookies and configure their name, value, and description
- How to enable or disable individual cookies without deleting them
- How to remove cookies you no longer need
- How the Cookie Manager relates to cookies you configure manually
When To Use This
Use the Cookies tab when you need to attach custom cookies to outgoing HTTP requests. This is useful when:
- Testing endpoints that rely on session cookies or authentication tokens passed as cookies
- Replicating browser behavior by manually sending cookies that a browser would include automatically
- Debugging cookie-based workflows where the server expects specific cookie names and values
- Temporarily disabling individual cookies to test server behavior without removing them entirely
Prerequisites
Before working with HTTP request cookies:
- Martini Designer installed and running
- At least one HTTP request created and opened in the HTTP Request Editor
Managing Cookies in HTTP Requests
The Cookies tab provides a dedicated interface for attaching cookies to individual HTTP requests.
Each cookie you add is compiled into the Cookie request header and sent to the server when the request is executed.
Adding Cookies to an HTTP Request
To add a cookie:
- Open the Cookies tab.
- Click the Add button in the Cookies toolbar, or press + .
- Fill in the following fields:
- Name – The cookie identifier sent to the server
- Value – The data assigned to the cookie, such as a session token or user ID
- Description – An optional note describing the cookie's purpose (not sent in the request)
Expected result: The new cookie appears in the cookie table and is automatically checked for inclusion in the request.
Enabling and Disabling Cookies
You can temporarily exclude a cookie from a request without deleting it. Use the checkbox next to the cookie name in the cookie table to include or exclude it.
- Checked – The cookie is included in the
Cookieheader when the request is sent - Unchecked – The cookie is excluded from the request but remains in the table for future use
This is useful when testing how the server responds to different cookie combinations without managing separate request configurations.
Deleting Cookies from a Request
To delete cookies:
- Select one or more cookies in the cookie table.
- Click the Delete button in the Cookies toolbar, or press .
Expected result: The selected cookies are permanently removed from the cookie table and are no longer sent with the request.
Cookie Manager
The Cookie Manager is a separate interface for viewing and managing all cookies that servers have sent back in previous HTTP responses. It complements the Cookies tab by persisting server-set cookies across sessions.
Use the Cookie Manager when you need to:
- Review cookies that servers automatically set during previous requests
- Manage long-lived session cookies that persist across multiple requests
- Clear or update cookies that were set by server responses rather than added manually
For full details, see Cookie Manager.
Troubleshooting HTTP Request Cookie Issues
| Problem | Detection | Cause | Fix |
|---|---|---|---|
| Cookie not sent with the request | Server returns an unexpected or unauthenticated response | Cookie checkbox is unchecked in the cookie table | Enable the checkbox next to the cookie name to include it in the request |
| Cookie value rejected by server | Server returns 401 or 403 response |
The Value field contains expired or invalid data | Update the Value field with a current, valid cookie value |
Helpful Resources
- Cookie Manager – Manage all cookies received from server responses across previous sessions
- Creating HTTP Requests – Learn how to create and configure HTTP requests in Martini
- Community Q&A: Martini Community
Have a question? Post or search it here.