This section described HTTP cookie correlation within a single iteration. For cookie correlation between multiple iterations see Session Persistence.

There are 2 types of HTTP cookies:

  • Session cookies are created by the server for the duration of the session. They do not have an expiration date but they only exist in memory the browser's and never written to disk. Typically, the browser sends these cookies to the browser on every session.
  • Persistent cookies have an expiration date and are stored on the disk until they expire. They can be created by the server or by the local browser (by a script). If the cookie was created by the server, it will not be sent to the browser until it expires.

Once a cookie has been established on the browser, the browser will send the cookie back to the server in subsequent requests. 

During script recording, StresStimulus saves all recorded cookies in the request. Then, during a script playback cookies are automatically correlated in the following ways.

Session cookies

The server sends session cookies to the browser by using the HTTP header Set-Cookie. During script playback, StresStimulus reads the Set-Cookie header from the response and automatically changes the recorded session cookie's value in subsequent requests. This allows for a fully automatic correlation.


In cases when a session cookie has a dynamic name, StresStimulus will automatically correlate the cookie name and value. The recorded cookie name will not be autocorrelated.

Persistent cookies

Since persistent cookies can be created by the server or by the local browser, they are handled differently.

Created by the server:

  • If the cookie expired then the new value will be autocorrelated as described above with session cookies. (Autocorrelated)
  • If the cookie did not expire, then autocorrelation is required and the recorded value will be used in the request. (Not Autocorrelated)

Created by the local browser script:

  • Since scripts are not executed during the load test, the cookie value will not change so the recorded value will be used in the request. (Not Autocorrelated)

Not Autocorrelated cookies

The persistent cookies that aren't correlated, will by default use their recorded values in requests during load tests. To change this behavior you can do the following:

  • To not use the recorded value, change the Send recorded cookies property of the request.
  • To change the recorded value to another constant value, use the request inspector to edit the Cookie header in the request.
  • To change the recorded value to a dynamic value, use the Set-Cookie object.
  • No labels