# SAML IDP-initiated SSO fails with cookie_not_found behind NGINX (Keycloak 26)
## What's going on
After upgrading to Keycloak 26.0.x behind an NGINX ingress/proxy, SAML IDP-initiated SSO failed with a cookie_not_found error in the logs, while SP-initiated login from Keycloak still worked. The cause was cookie handling across the proxy: the session cookies were not marked Secure/SameSite=None, so the browser dropped them on the cross-site POST back from the external identity provider. Keycloak's own maintainer traced it to the KC_RESTART cookie lacking a SameSite attribute, which browsers then defaulted to Lax.
## The verified fix
Add proxy_cookie_flags ~.* secure samesite=None; to the NGINX config (as an ingress annotation if you use ingress-nginx), which marks the Keycloak cookies Secure and SameSite=None so they survive the cross-site IDP POST. Multiple reporters on Keycloak 26.0.x confirmed this fixed the cookie_not_found error. Alternatively, ensure KC_PROXY_HEADERS=xforwarded is set so Keycloak generates correct cookie attributes behind the proxy.
Source: https://github.com/keycloak/keycloak/issues/20490
## How to use this
Take the question above and check if it matches what you're seeing. If it does, work through the verified fix step by step. Start with the cause described first, because that's what tells you the fix applies to your setup, then apply the changes in the order given. Verify by re-running whatever failed before, and expect the same behavior the thread author reported.