Set secure
and samesite
when deleting remember cookie
#873
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a fix for the issue reported in #683. As per the linked issue, in some browsers, the expectation is to set the same values for
Secure
andSameSite
when deleting as were set when creating the cookie.The implementation in this PR changes the call to
response.delete_cookie
to set the samesecure
andsamesite
argument values as were set whenresponse.set_cookie
is invoked. In the implementation, I've also added code comments to have the structure of the_clear_cookie
method mirror that of the_set_cookie
method (wheresecure
andsamesite
are initially set on cookies).All checks are passing locally using
tox
:As an aside, this is my first time contributing on this repository, and I noticed a dead link in the
CONTRIBUTING.md
file, so I've corrected it in this PR. Apologies if this makes the PR less granular and isn't strictly adhering to PR etiquette!