A stateful web test needs to recognize the same visitor across requests. In JMeter, the HTTP Cookie Manager stores cookies returned by the server and sends them with later requests so a login session can continue.
Each JMeter thread has its own store of server-set cookies, so virtual users keep separate sessions. A manager under the relevant Thread Group covers its HTTP samplers; multiple managers in the same sampler's scope can make cookie handling unpredictable.
The login and follow-up HTTP samplers need to exist before the manager can be tested. A one-user, one-loop GUI run with a View Results Tree listener makes the outgoing cookie visible without starting a load test.
A login test sends real requests to the application. A test account and a test environment avoid changing a real user's session or data.
Steps to add a JMeter HTTP Cookie Manager:
- Select the Thread Group containing the login and session-dependent HTTP samplers.
The plan shown has a Login request followed by an Account request that requires the login cookie.
- Add HTTP Cookie Manager through the Thread Group's right-click Add → Config Element → HTTP Cookie Manager menu.

- Keep the cookie-clearing options unchecked to retain the session across loop iterations.
With Use Thread Group configuration to control cookie clearing disabled, Clear cookies each iteration? controls whether server-set cookies are discarded between loops. If each loop should start as a new visitor, enable Clear cookies each iteration? instead.
The default standard cookie policy suits normal HTTP sessions. The User-Defined Cookies table stays empty for cookies received from the server; manually entered cookies instead supply a shared value to all threads.
- Save the test plan with File → Save.

- Start the one-user, one-loop test with Run → Start.
For load testing after this small check, use non-GUI mode.
- Open View Results Tree in the test-plan tree.
- Select the later session-dependent request in the results list.
The Account sample is the request after Login in this plan.
- Open the selected sample's Request tab.

- Confirm that Cookie Data contains the server's session cookie on the follow-up request.
The Request Body view shows a session cookie sent to Account. An empty Cookie Data section can mean that the login returned no cookie or that its domain, path, or Secure flag does not match the follow-up URL.