jmeter icon indicating copy to clipboard operation
jmeter copied to clipboard

HTTP Cookie Manager does not remove cookies after they reach their Expiry or Max-Age time.

Open rahulkotha07 opened this issue 10 months ago • 0 comments

Expected behavior

  • The HTTP Cookie Manager should be enhanced to: 1. Capture the expiry time from the Set-Cookie response header. 2. Store the cookie with its correct expiration time. 3. Automatically remove expired cookies instead of keeping them indefinitely.

Actual behavior

  • The HTTP Cookie Manager automatically adds cookies when they are received through response headers.
  • However, once a cookie is set, it does not get removed even after it has reached its expiry time.

Steps to reproduce the problem

  1. Setup HTTP Cookie Manager Open JMeter (or the relevant tool where the HTTP Cookie Manager is used). Add an HTTP Cookie Manager to the test plan. Ensure "Clear cookies each iteration?" is unchecked (so cookies persist).
  2. Send an HTTP Request that Sets a Cookie Create an HTTP Request to an endpoint that responds with a Set-Cookie header. Ensure the response includes a cookie with an Expires or Max-Age attribute. Example response header:
  • Set-Cookie: session_id=abc123; Expires=Wed, 19 Feb 2025 12:00:00 GMT; Path=/; HttpOnly Verify that the cookie is stored in the Cookie Manager.
  1. Wait Until Cookie Expiry Time Passes Manually modify the system time past the cookie expiry or wait for the expiration time to pass. Send another HTTP Request to the same endpoint without clearing cookies.
  2. Observe the Issue The expired cookie should be removed, but it is still being sent in subsequent requests. This indicates that the HTTP Cookie Manager does not remove cookies even after expiration.
  3. Expected Behavior The Cookie Manager should detect expired cookies based on the Expires/Max-Age header. Expired cookies should not be included in subsequent requests.

JMeter Version

5.7

Java Version

17

OS Version

Microsoft Windows 10 Pro Version : 10.0.19045 Build 19045

rahulkotha07 avatar Feb 22 '25 09:02 rahulkotha07