T
TanStack4mo ago
deep-jade

Can't access cookie after a location.replace()

An external website makes a redirection to my website. In my loader, I call a serverFn that do a getCookie. The problem is that the external websites seems to execute a location.replace(THE_URL_TO_MY_WEBSITE) and the loader is correctly executed but can't access my website cookie (it returns null). But if I reload my page the loader access correctly the cookie. Any idea?
2 Replies
extended-salmon
extended-salmon4mo ago
can you reproduce this in a simple example? is the loader running on client side only maybe in that scenario?
deep-jade
deep-jadeOP4mo ago
Yes will try to make simple reproduction example tomorrow. Yes I think there is something about client side here. But since my getCookie is called from a serverFn, I don't understand what's wrong... @Manuel Schiller The problem was due to sameSite option set to true. Changed it to "lax" solved the issue

Did you find this page helpful?