Skip to content

Commit

Permalink
Add parameters to del_cookie() (#8956) (#8959)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9738426)
  • Loading branch information
Dreamsorcerer authored Aug 31, 2024
1 parent e8d6638 commit 7477503
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/8956.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added ``secure``/``httponly``/``samesite`` parameters to ``.del_cookie()`` -- by :user:`Dreamsorcerer`.
12 changes: 11 additions & 1 deletion aiohttp/web_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,14 @@ def set_cookie(
c["samesite"] = samesite

def del_cookie(
self, name: str, *, domain: Optional[str] = None, path: str = "/"
self,
name: str,
*,
domain: Optional[str] = None,
path: str = "/",
secure: Optional[bool] = None,
httponly: Optional[bool] = None,
samesite: Optional[str] = None,
) -> None:
"""Delete cookie.
Expand All @@ -266,6 +273,9 @@ def del_cookie(
expires="Thu, 01 Jan 1970 00:00:00 GMT",
domain=domain,
path=path,
secure=secure,
httponly=httponly,
samesite=samesite,
)

@property
Expand Down

0 comments on commit 7477503

Please sign in to comment.