Cookies does not persist when deployed, it works fine in development. When the user logged in, I will send a cookie into the browser, with an option of http only, same site is true, even tried strict, secure to true, max age into a day. It work’s fine at the very first, I get the cookie and the response fine, but after I refresh the site the cookies are long gone. Can’t find a solution online, almost every stack overflow that encountered the same problem doesn’t have a solution. I am using react with vite build, in the client, and express nodejs in the backend. I am not using a session in the backend. Can somebody help me with it? This is my first time deploying a site, please take easy on me. Thanks a lot in advance!
Hi there,
Here are a few community articles that discuss common issues with cookies
- https://community.render.com/t/sended-cookie-is-not-getting-set-on-frontend/15007
- https://community.render.com/t/setting-cookies-onrender-com/7886/3
The best approach is to use a custom domain to have the most control, and avoid complicated workarounds.
Regards,
Matt
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.