Description
To help us debug your issue fill in the basic information below using the options provided
Serverless Java Container version: com.amazonaws.serverless:aws-serverless-java-container-springboot3:2.0.0
Implementations: Spring Boot 3
Framework version: eg SpringBoot3 2.0.0
Frontend service: REST API / ALB
Deployment method: SAM
Scenario
When calling servletResponse.addCookie method with max-Age set to 0, cookies are not getting deleted.
Expected behavior
Max-Age 0 is a valid value for cookies to expire immediately and a common way to delete cookies.
Actual behavior
Cookies are being set to session cookies instead of getting deleted. Had to do a workaround to set max-Age to 1 and have it expire after 1 second.
Source code that causes this issue
Steps to reproduce
- Call servletResponse.addCookie(Cookie(name, value, 0, domain)) method
- Check cookies from application section in browser developer console.
- Cookies that are intended to be deleted will show as session cookies and not getting deleted
Full log output
I am running a project that cannot be shared on public github