Traefik Proxy update response cookies SameSite to None

I have Traefik Proxy in front of several web apps and I want to be able to modify the response to the client so that all cookies have SameSite set to None.

This is because Google Chrome is blocking cookies within iframes for my web apps that use external Single Sign On (SSO) services, eg. OpenAM.

An example for APACHE WEB SERVER would be the following:

<IfModule mod_headers.c>
        Header edit Set-Cookie ^(.*)$ "$1; Secure; SameSite=None"
        Header always edit Set-Cookie ^(.*)$ "$1; Secure; SameSite=None"
</IfModule>

Is this possible in Traefik using configuration labels set on the web app services? Or a plugin?

Hi @ultrasine, thanks for your interest in Traefik!

You could check one of the many Traefik header plugins .

@svx Thank you for the tip!

I saw the plugins but somehow missed looking for "header" related ones. Now I have to figure out which plugins could help and what magic configuration is required to rewrite the cookie header :wink:

I've been lost on the web trying to figure this out. I managed to create a simple python proxy inbetween traefik and my web apps to do the job but it would be good to not have another piece in the jigsaw.

If I manage to resolve this I'll post my results as it will help others I'm sure.

@svx I learned how to write a plugin and figured how to do what I wanted! Thanks again.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.