diff --git a/graphql_jwt/utils.py b/graphql_jwt/utils.py index aff19515..66647739 100644 --- a/graphql_jwt/utils.py +++ b/graphql_jwt/utils.py @@ -137,8 +137,11 @@ def set_cookie(response, key, value, expires): def delete_cookie(response, key): - response.delete_cookie( - key, - path=jwt_settings.JWT_COOKIE_PATH, - domain=jwt_settings.JWT_COOKIE_DOMAIN, - ) + kwargs = { + "path": jwt_settings.JWT_COOKIE_PATH, + "domain": jwt_settings.JWT_COOKIE_DOMAIN, + } + if django.VERSION >= (2, 1): + kwargs["samesite"] = jwt_settings.JWT_COOKIE_SAMESITE + + response.delete_cookie(key, **kwargs)