Search code examples
sap-commerce-cloud

How to resolve the component session in CCV2?


Context:

In ccv2, with two front-end machines, when the user logs in, the component still has the anonymous session. The session needs to be updated or even force the component's renderer. This is because the content of the product carousel changes depending on whether the user is logged in or not.

Observations:

  • Cache flags are disabled.
  • It works perfectly in the local environment.
  • I've tried adding user information in the controller and before the handler.
  • I've disabled cookies.SameSite.enabled to false.
  • I've used this approach: hasAnyRole('ROLE_ANONYMOUS').

enter image description here


Solution

  • Even with cms.cache disabled on all machines, the solution only worked when I removed the ProductCarouselComponent from cacheKeyProviders