We have a website built with Laravel 10 (upgraded from Laravel 5.6 to 9, and then to version 10). For this website, we use a load balancer on Cloudflare. However, since we are using the StartSession (IlluminateSessionMiddlewareStartSession) and VerifyCsrfToken (AppHttpMiddlewareVerifyCsrfToken) middleware, the response headers for every page include two Set-Cookie headers. Because of the Set-Cookie headers in the response, Cloudflare prevents the page from being cached and directly serving from the Cloudflare cache for subsequent requests.
How can we resolve this issue to allow Cloudflare to cache the pages while still using the necessary middleware in Laravel?
Cloudflare documentation: https://developers.cloudflare.com/cache/concepts/cache-control/#conditions