Managing Cookies Using the HTTP Client
Introduction
The HTTP Client in Martini Desktop features a Cookie Manager, which is essential for handling cookies across different domains. It allows you to store, modify, and manage cookies, making it easier to maintain session states and manage authentication requirements.
Cookie Management
Cookie Persistence
- Storage: Cookies sent by the server in response to requests are stored and persisted by the Cookie Manager.
- Accessibility: Persisted cookies remain accessible and modifiable even after closing and reopening Martini Desktop.
Cookie Precedence
- When sending an HTTP request, the Cookie Manager automatically includes cookies that match the request's domain and URL.
- If both the Cookie Manager and the Cookies tab of a request contain a cookie with the same name, the cookie defined in the Cookies tab takes precedence.
Accessing the Cookie Manager
- To open the Cookie Manager, click the cookie-shaped icon located in the top-right corner of the HTTP Client’s Request panel.
Adding a New Domain
- Initiate Domain Addition: Click the "+" button at the top of the Domain panel, next to the search bar.
- Enter Domain Details: Type the host name (excluding scheme, port, and query string).
- Confirm Addition: Press the Enter key to add the domain.
Adding a New Cookie
- Select a Domain: Choose the domain to which the cookie will be associated.
- Initiate Cookie Addition: Click the "+" button in the top-right corner of the cookie table.
- Enter Cookie Details: Double-click a cell to edit its value, pressing Enter to finalize each cell's content.
Disabling a Cookie
- Functionality: To prevent a cookie from being sent with requests, uncheck the checkbox beside its name.