Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deleting a cookie that was created with secure=False #2976

Merged
merged 6 commits into from
Jun 30, 2024

Conversation

ashleysommer
Copy link
Member

Add ability to create a non-secure delete-cookie.
Also re-use existing cookie properties where possible if deleting a cookie that is already known in the response headers. Sanity-check and correct deletion cookie's secure_prefix and host_prefix based on the value of secure bool.

Add tests for these three things. (they were failing before the fix, passing after the fix).
Fixes #2972

Also re-use existing cookie properties where possible if deleting a cookie that is already knowin in the response headers.
Sanity-check and correct deletion cookie's secure_prefix and host_prefix based on the value of secure bool.
@ashleysommer ashleysommer requested a review from a team as a code owner June 28, 2024 07:56
sanic/cookies/response.py Outdated Show resolved Hide resolved
@ahopkins ahopkins merged commit 90e3beb into sanic-org:main Jun 30, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot delete cookies due to missing secure parameter
2 participants