Sometimes you may need to manually send back the cookies a server set in a previous HTTP response (e.g. a login token, or session ID…). The server sets a Set-Cookie
header in its HTTP response, and you may want to send back those cookies in a proper format in a subsequent HTTP request. The Response Cookies Dynamic Value will extract the cookies from a previous HTTP response, and format them in a way to be ready to be sent back in a Cookie header.
Example
Here’s an example scenario:
- A request calls
POST /api/login
- The server sets a session ID cookie in the response:
Set-Cookie: SESSION_ID=4242; Expires=Wed, 09 Jun 2021 10:18:14 GMT
- In the next request, you want to send back this cookie as
Cookie: SESSION_ID=4242
In the Headers tab, add a new header named Cookie and right-click on the value field to pick Cookies > Response Cookies.