Using Cookies

Using Cookies

Add cookies to a request in your load test when the page or API you test needs them, for example a session cookie or an authentication token. LoadFocus sends them with that request.

Add a cookie to a request

  1. In the request you are configuring, click Cookies. The number next to it shows how many cookies the request has.
  2. Click Add cookie.
  3. Fill in the four fields:
    • Name: token
    • Value: djs34567ajdlasjdklas765756kjdas (the cookie value, such as an authentication token)
    • Domain: example.com (the domain the cookie applies to)
    • Path: /or/my_folder/ (the path the cookie applies to)
  4. Click Add cookie again for more cookies, or the trash icon at the end of a row to remove one.

Cookies

Cookies are set per request. If several requests in the test need the same cookie, add it to each of them.

What it is useful for

  • Testing pages and endpoints that need a logged-in user, by sending a session cookie or token.
  • Testing user-specific content, such as preferences or a shopping cart, by sending the cookie that identifies that user.
  • Sending cookies for different subdomains, using the Domain field.

The cookie form has no fields for flags such as Secure or HttpOnly.