Improvement
Apr 24, 2025
What has changed?
In the AI Commerce Cloud development environment (https://localhost:3000), all /api/ requests are now proxied internally through Vite to https://kauppa.com.
The proxy strips the Domain= attribute from the Set-Cookie header, allowing the _cookieCheck to be saved as a host-specific cookie already in the server-side rendering (SSR) response.
Benefits
Before | Now |
---|---|
The session was created only after the first client-side API call → required an extra click or reload to make session data available. | The session is created already on the first page load. You can directly open, for example, the /checkout page, update, and read session data without additional interactions. The development cycle is significantly faster. |
Technical summary
Added a Vite proxy rule: /api/ → https://kauppa.com (with cookieDomainRewrite: '').
During SSR, /api/ is marked as bypassed so the proxy handles the request.
CORS and SameSite=None; Secure settings remain unchanged.
No changes needed in partner code — simply update the repo, start the dev server, and sessions will work immediately.
This improvement greatly enhances development smoothness and speeds up testing.