Enhance HC4CookieHandler to Support Multiple Cookies with Individual Expiry Times
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):
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.
Would you please add a test case for the change?
Sure, I have added the Unit test case now. Thanks.