How do I manually set a cookie in a script?
In most cases, it’s not necessary to manually set a Cookie header. Loadster automatically receives Set-Cookie headers from your server and regurgitates the cookies like any other HTTP user agent. However, if you need to manually send a cookie from your script that was not received from the server, here is how you would do it.
First of all, click the Add… menu on the step you want to add the cookie for, and choose Add request header.
Enter the header name of “Cookie” and the header value as the key-value pair. For this example, we’ll go with a cookie name of “a” and a value of “1”.
After playing your script, you’ll see a message about the custom request header in the logs:
You can also drill into the request to view the exact headers that were sent:
You can read more about the Cookie header in general on the Mozilla Developer Network.