- Created by SS Doc Editor, last modified on Jun 09, 2023
StresStimulus handles HTTP cookie correlation automatically. Every time a server response contains a Set-Cookie header, StresStimulus acts accordingly and sets the request HTTP cookie value in all subsequent requests. However, in rare instances, the request cookie value is set by some client-side script and can't be automatically correlated. For example, an application can have a client script that, after every click, sets a timeout cookie to a few minutes into the future to monitor user inactivity. While load testing such a test case, the recorded value of this cookie can't be used because the server will think the VU is inactive. In these cases, you can use the Set-Cookie object to parameterize the cookie value manually.
To use the set-cookie object:
PropertiesIn the Set-Cookie property grid, set the following properties.
Persistent request cookiesThe Set-Cookie object emulates a Set-cookie HTTP response header that is described here. A subsequent Set-cookie HTTP response cookie will override the value from the previous header and the previous Set-Cookie object. To prevent using the new value, set the Is Persistent property to Yes. Clearing the Affinity cookieOne example of when this would be helpful in clearing the affinity cookies (these cookies are used to route requests to a single server behind a load balancer). Typically, if the affinity cookie is missing in the request, the server will create a new one and send it in the Set-cookie response header. To permanently clear the affinity cookie from all requests, add a Set-Cookie object, clear the Value property, and set the Is Persistent property to Yes. See the example below. |
- No labels