Improvement
Apr 24, 2025
What has changed?
The AI Commerce Cloud dev environment (https://localhost:3000) now forwards all /api/* requests through the internal Vite proxy to https://kauppa.com-backend. The proxy removes the Domain=- attribute from the Set-Cookie header, allowing _cookieCheck to be stored as a host-specific cookie already in the server-side rendering (SSR) response.
What are the benefits?
Before: The session was created only after the first client-side API call → the page had to be clicked or reloaded before the session data was available.
Now: The session is generated on the first page load. You can directly open, for example, the /checkout page, update and read the session data without any additional clicks. This speeds up the development cycle.
Technical summary
A proxy rule /api/ → https://kauppa.com was added to the Vite configuration (cookieDomainRewrite: '').
In SSR, /api/ is marked as bypassed so that the proxy handles the request.
CORS and SameSite=None; Secure settings remain unchanged.
No changes are required in partner code – update the repo, start the dev server, and sessions will work immediately. This improves the smoothness of development and significantly speeds up testing.