There are 2 types of HTTP cookies:

  • Session cookies are used by a physical browser that accesses a website to maintain application session persistence. They are usually stored in the browser's memory until it is closed. After the browser is restarted and navigated to the same website, a new application session will be established. A website session is controlled by one (or more) HTTP session cookies, so a new session means a new cookie value. 
  • Non-session cookies are used by a physical browser to persist website data for an extended period of time. They are usually stored in a file on the browser's machine until expiration. 

In StresStimulus, a VU can either restart a browser on every iteration (the session cookie will change on every iteration) or leave the browser open across all iterations (the session cookie will stay the same on every iteration). Maintaining session persistence across all iterations can be useful when a test case has a login process that needs to be done only on the first iteration and not on subsequent iterations.

Here are two examples:

  • Internal users sign in to the application in the morning and maintain the same session while navigating through the scenario many times throughout the day. The server renders a session cookie on the first iteration, and StresStimulus will reuse it in subsequent iterations. A login is not required in subsequent iterations.
  • On the contrary, external users who use the application occasionally sign in whenever they need to navigate through a scenario. A new session cookie is assigned in every iteration. A login is most likely required in every iteration as well.

Use the Cookie correlation scope to set which cookies are correlated between iterations. 

  • Select All to auto-correlate all cookies. This will simulate VUs that keep their browsers open and have their session persist across all iterations. The session identified by a cookie was carried over to the subsequent iteration.
  • Select None to stop correlating all cookies and use the recorded values instead. This option eliminates session persistence between iterations to emulate a user that re-opens the web browser on every iteration. 
  • Select Session to auto-correlate only session cookies.
  • Select Non-session to auto-correlate only non-session cookies.


Note: Session persistence within an iteration is always maintained.

Cookie correlation within a test case group

Starting from v5.8, in a test case group, the Cookie correlation scope property is honored for every child test case. For example, in a TC Group with TC1 and TC2, to clear the session between TC1 and TC2, set the Cookie correlation scope property of TC1 to None.

  • No labels