sanic-org / sanic

Accelerate your web app development | Build fast. Run fast.
https://sanic.dev
MIT License
17.86k stars 1.53k forks source link

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

Closed ashleysommer closed 3 days ago

ashleysommer commented 5 days ago

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