Skip to content

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

Merged
ahopkins merged 6 commits into
sanic-org:mainfrom
ashleysommer:fix_delete_nonsecure_cookie
Jun 30, 2024
Merged

Fix deleting a cookie that was created with secure=False#2976
ahopkins merged 6 commits into
sanic-org:mainfrom
ashleysommer:fix_delete_nonsecure_cookie

Conversation

@ashleysommer

Copy link
Copy Markdown
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 ahopkins June 28, 2024 07:56
@ashleysommer ashleysommer requested a review from a team as a code owner June 28, 2024 07:56
Comment thread sanic/cookies/response.py Outdated
@ahopkins ahopkins merged commit 90e3beb into sanic-org:main Jun 30, 2024
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