How do I clear cookies after each call in a .hurl file? #1740
-
Hi, I have a set of tests, (consecutive) calls in one .hurl file. I want the cookies to be cleared after each call so that they resemble a new request. I have tried the -b option (to use a cookies.txt file for each request) and I can see something like this when I run in --verbose mode curl --header 'Content-Type: application/json' --header 'api-key: API_KEY' --data $'PAYLOAD' --cookie 'oneCookie=xxxxxxxxxxxx; twoCookie=yyyyyyyyyyyyyyyy; JSESSIONID=zzzzzzzzzzz' --cookie cookies.txt 'endpoint' The cookies just add up and sends both the received and the ones in cookies.txt. I need to ideally clear the cookies between each call or at least ONLY use the ones in the cookies.txt file. In short: How do I clear the cookies between each call. Apologies if the answer is obvious but I have not made this work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, you're right we don't have any official mechanism to clear cookie storage. That said, there is an undocumented way of clearing cookie before a request:
This special comment will clear the cookie storage. It's undocumented because, for the moment, we are not sure about how to deals (syntax wise) with these kind of commands. In your case, a better way would be to implement a new option |
Beta Was this translation helpful? Give feedback.
Hi, you're right we don't have any official mechanism to clear cookie storage. That said, there is an undocumented way of clearing cookie before a request:
This special comment will clear the cookie storage. It's undocumented because, for the moment, we are not sure about how to deals (syntax wise) with these kind of commands.
In your case, a better way would be to implement a new option
--no-cookie-storage
that will prevent a cookie store within a Hurl file.