Skip to content

Commit

Permalink
add params for partitioned in set_cookie and delete_cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
dgwn authored and pgjones committed Mar 5, 2024
1 parent 5643979 commit 32e6951
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/werkzeug/sansio/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def set_cookie(
secure: bool = False,
httponly: bool = False,
samesite: str | None = None,
partitioned: bool = False,
) -> None:
"""Sets a cookie.
Expand All @@ -218,6 +219,7 @@ def set_cookie(
:param httponly: Disallow JavaScript access to the cookie.
:param samesite: Limit the scope of the cookie to only be
attached to requests that are "same-site".
:param partitioned: If ``True``, the cookie will be partitioned.
"""
self.headers.add(
"Set-Cookie",
Expand All @@ -232,6 +234,7 @@ def set_cookie(
httponly=httponly,
max_size=self.max_cookie_size,
samesite=samesite,
partitioned=partitioned,
),
)

Expand All @@ -243,6 +246,7 @@ def delete_cookie(
secure: bool = False,
httponly: bool = False,
samesite: str | None = None,
partitioned: bool = False,
) -> None:
"""Delete a cookie. Fails silently if key doesn't exist.
Expand All @@ -256,6 +260,7 @@ def delete_cookie(
:param httponly: Disallow JavaScript access to the cookie.
:param samesite: Limit the scope of the cookie to only be
attached to requests that are "same-site".
:param partitioned: If ``True``, the cookie will be partitioned.
"""
self.set_cookie(
key,
Expand All @@ -266,6 +271,7 @@ def delete_cookie(
secure=secure,
httponly=httponly,
samesite=samesite,
partitioned=partitioned,
)

@property
Expand Down

0 comments on commit 32e6951

Please sign in to comment.