neha bedi
neha bedi

Reputation: 156

What type of cookies are automatically extracted by HTTP Cookie Manager component of Jmeter?

As the HTTP Cookie Manager stores and sends cookies like a web browser does

Some of the cookies are automatically extracted & stored and other are to be explicitly defined using User defined cookie field in it .What type of cookies are picked automatically by Cookie manager?

Upvotes: 2

Views: 476

Answers (2)

timbre timbre
timbre timbre

Reputation: 13985

There's no single right answer unfortunately. Generally anything coming via Set-Cookie header in the response, will at least be evaluated by JMeter and considered for storage within cookie manager. But results of the evaluation depend on 3 parameters, so in the end of the day the following cookies will be saved:

  • A small simple rule: if cookie is null, CookieManager.delete_null_cookies parameter in jmeter.properties decides whether such cookie will be further evaluated or discarded. By default cookies with null value are discarded.

  • Cookies are further evaluated, based on selected Cookie Policy for the selected Implementation (those 2 parameters you specify in UI). For HC3CookieHandler implementation the default is a compatibility policy, which is described as:

    The policy that provides high degree of compatibility with common cookie management of popular HTTP agents.

    For HC4CookieHandler, the default policy is standard, which is described as

    State management policy compliant with a more relaxed profile defined by RFC 6265, section 4 intended for interoperability with existing servers that do not conform to the well behaved profile.

JMeter docs do not say much about all the cookie policies, although they are the most important factor in save/don't save decision. Mostly policies are related to security and specs of the cookies (for example accept 3rd-party cookies or not; accept cookies with missing fields or not; consider sub-domains to be 3rd-party cookies or not). The following pages give you a summary of policies: for version 3 (matches HC3CookieHandler implementation) and version 4 (matches HC4CookieHandler). But for full details on what each policy accepts and rejects, you'd have to dig into RFCs.

Upvotes: 2

UBIK LOAD PACK
UBIK LOAD PACK

Reputation: 34536

All valid cookies for sent request are extracted by JMeter as per the RFC.

JMeter does not save by default invalid cookies or cross domain ones.

You can change this behaviour by setting property : - CookieManager.check.cookies=false

Read this:

The values you enter in table are those you want to send and that were not previously set by server for example:

  • you want to simulate cookie persistant basket on a website
  • you create a set of baskets each one with an id that will be in cookie
  • you put those ids in a CSV, use a CSV Dataset in Jmeter exporting variable basketId
  • you then use Cookie Manager and put in the table basketId=${basketId}

Upvotes: 2

Related Questions