jmeter icon indicating copy to clipboard operation
jmeter copied to clipboard

Enhance HC4CookieHandler to Support Multiple Cookies with Individual Expiry Times

Open rahulkotha07 opened this issue 7 months ago • 2 comments

Description

This change enhances the HC4CookieHandler.java to support handling multiple cookies, each with its own configurable expiry time (via Max-Age). It ensures cookies are properly invalidated and removed after expiry so that new cookies are issued on subsequent requests.

Motivation and Context

The original implementation supported a single cookie with expiry. This enhancement allows testing of multiple cookie scenarios with different lifetimes, which is critical for applications simulating real-world session behavior or user tracking. It helps validate cookie expiration handling in downstream systems using Apache JMeter’s HTTP components.

How Has This Been Tested?

Manual testing via a custom Spring Boot application that sets multiple cookies with varying Max-Age values. JMeter was used to trigger requests and verify that cookies expired and were reissued correctly. Verified cookie storage and expiry via debug logs and inspection of request headers.

Screenshots (if appropriate):

image image image image image

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • [x] My code follows the code style of this project.
  • [x] I have updated the documentation accordingly.

rahulkotha07 avatar May 25 '25 13:05 rahulkotha07

Would you please add a test case for the change?

vlsi avatar May 25 '25 14:05 vlsi

Sure, I have added the Unit test case now. Thanks.

rahulkotha07 avatar May 25 '25 20:05 rahulkotha07