'Cookie not found. Please make sure cookies are enabled in your browser

I'm using keycloak version 16.1.1 in kube environment. I use a custom theme for the login page, nothing weird, just a logo and a different background image. It is used as identity server for my reactjs application with a golang backend, so I add a clientID called webui. I works fine, but times to times it gave me back an error when I try to login:

enter image description here

And I cannot to anything but enter the right url again,wait to be redirect to the login page and try again. Sometimes it goes straight some other time it takes 2-3times before log in. I have no idea what cookie has to do with this. I try different browser, private/incognito as well, same behaviour. Maybe it is a paramenters in configuration that I miss. I already delete cookies and cache from my browser.

UPDATE I noticed that as cookie first time I land on the login page I have only AUTH_SESSION_ID_LEGACY cookie and when I have only this it gives me the error. If I refresh the page then another cookie KC_RESTART appears and then the login works just fine. As mention below I have a refirection on keycloak login page



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source