skip to content

Cookies Cache and Headers

The config elements that give each thread browser-like state - a cookie store, a simulated cache, headers, credentials and its own DNS. Each one quietly moves the numbers you report.

on this pageshow

explore

questions

6

Which JMeter property stops the HTTP Authorization Manager from sending BASIC credentials unchallenged?

level: middleimportance: should knowfreq 40%

basics

~10 s

Set httpclient4.auth.preemptive=false in user.properties. The HttpClient4 implementation defaults it to true, so the Authorization header rides on the very first request; with it false, credentials go only after the server sends a challenge.

open as a page

In a JMeter plan with an HTTP Cache Manager, why does the second iteration log fewer samples?

level: seniorimportance: should knowfreq 52%

basics

~10 s

JMeter's HTTP Cache Manager serves a still-fresh GET out of the thread's own cache without touching the network, and its default cached-resource mode, RETURN_NO_SAMPLE, records no result at all for that hit.

open as a page

In a JMeter run against a load-balanced hostname, why does every thread hit the same backend IP?

level: seniorimportance: should knowfreq 45%

basics

~20 s

Without a DNS Cache Manager, JMeter resolves the hostname through the JVM's own DNS cache, so every thread reuses the first address that came back. Adding the element gives each thread a private resolution cache instead.

open as a page

How would you decide which browser-like state a JMeter plan keeps between thread iterations?

level: principalimportance: should knowfreq 33%

basics

~20 s

JMeter has no single reset: the Cookie, Cache, DNS Cache and Authorization Managers each carry their own per-iteration clearing option. Name the population you are simulating, then set all four deliberately in a plan template.

open as a page

In JMeter, how do you make the HTTP Cookie Manager expose received cookies as thread variables?

level: middleimportance: nice to knowfreq 28%

basics

~10 s

Set CookieManager.save.cookies=true in bin/user.properties before JMeter starts. Every cookie the manager stores is then written to a thread variable carrying the COOKIE_ prefix, so a cookie named TEST is read as ${COOKIE_TEST}.

open as a page