From 29cbbcab80869844575d8bb6e9893d1d29bc4382 Mon Sep 17 00:00:00 2001 From: Rafael Griffo Goes Date: Thu, 11 Mar 2021 10:17:34 -0500 Subject: [PATCH] Adjusting the setting of SameSite property for CookieTest: it will get SameSite=None regardless of samesite setting, unless samesite property is disabled. Addresses #20 and likely #47 --- auth_mellon_cookie.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/auth_mellon_cookie.c b/auth_mellon_cookie.c index 6bff81e..7686cec 100644 --- a/auth_mellon_cookie.c +++ b/auth_mellon_cookie.c @@ -78,16 +78,13 @@ static const char *am_cookie_params(request_rec *r) } if (env_var_value == NULL){ - if ((cfg->cookie_samesite != am_samesite_default) && - (apr_table_get(r->notes, AM_FORCE_SAMESITE_NONE_NOTE) != NULL)) { + if (cfg->cookie_samesite == am_samesite_none || + apr_table_get(r->notes, AM_FORCE_SAMESITE_NONE_NOTE) != NULL){ cookie_samesite = "; SameSite=None"; - } - else if (cfg->cookie_samesite == am_samesite_lax) { + } else if (cfg->cookie_samesite == am_samesite_lax) { cookie_samesite = "; SameSite=Lax"; } else if (cfg->cookie_samesite == am_samesite_strict) { cookie_samesite = "; SameSite=Strict"; - } else if (cfg->cookie_samesite == am_samesite_none) { - cookie_samesite = "; SameSite=None"; } }