How do I get my cookie issued by a service in my kubernetes cluster set in my frontend correctly? How do I get my cookie issued by a service in my kubernetes cluster set in my frontend correctly? kubernetes kubernetes

How do I get my cookie issued by a service in my kubernetes cluster set in my frontend correctly?


Looks like session affinity is a good option to try first.

Could you please try to add the following annotations to all your ingress rules and check if that can help you to solve the issue?

nginx.ingress.kubernetes.io/affinity     cookienginx.ingress.kubernetes.io/affinity-mode   persistentnginx.ingress.kubernetes.io/session-cookie-name hasura-backendnginx.ingress.kubernetes.io/session-cookie-change-on-failure    true

Alternatively, you can try to eliminate https2http termination that most likely is a reason that your FE application doesn’t see the cookie.

On a screenshot, it is seen that Set-Cookie header has a secure flag set. In order to eliminate SSL termination, you can attach Public IP addresses to your worker nodes of K8s, then activate SSL annotation in ingress and have a direct https connection to your frontend.


The Set-Cookie comes from a different domain, so the browser does nothing about it. The key phrase for your problem is "cross-origin set cookie".