Cookie issue on frontend

Hello, I have hosted frontend (React vite app) and also backend Spring boot server. So I have 1 static website and 1 server hosted on render, I do not use custom domains just subdomains generated by render.com. The REST API’s work fine the only problem I have is on adding cookies on frontend. I think errors are about “samesite” attribute and also domain. This is my cookie setup:
ResponseCookie cookie = ResponseCookie.from(cookieName, value)
.httpOnly(httpOnly)
.secure(true)
.maxAge(expiration)
.path(“/”)
.domain(“onrender.com”)
.sameSite(“Strict”)
.build();

Hi Luka,

It sounds like this community post may be relevant to your use case: https://community.render.com/t/sended-cookie-is-not-getting-set-on-frontend/15007

Setting up a free custom domain might be your easiest solution.

Regards,

Matt

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.