From 5a629a13aa321ce2571fd88989ca61d1f0ae5587 Mon Sep 17 00:00:00 2001 From: Rafael G Goes Date: Fri, 19 Mar 2021 13:14:09 -0400 Subject: [PATCH] Adjusting the setting of SameSite property for CookieTest: it will (#57) 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"; } }