Skip to content

web: Cookie updates #3224

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

Merged
merged 3 commits into from
Jan 30, 2023
Merged

web: Cookie updates #3224

merged 3 commits into from
Jan 30, 2023

Conversation

bdarnell
Copy link
Member

Various updates to cookie APIs

  • Rename 'secure' to 'signed' in cookie methods
  • clear_cookie accepts additional arguments
  • clear_all_cookies is deprecated

This more precisely states the kind of security that is provided, and
avoids confusion with the use of the word "secure" as a standard
cookie attribute and prefix.
Multiple arguments needed special cases anyway, so it's better to
just be explicit about what's supported.

set_signed_cookie still uses kwarg forwarding since we don't need
to worry about the special cases at this level and using
explicit arguments would involve duplicating defaults in multiple
places.
In some cases it is now required to pass matching values for
samesite and secure as when the cookie was set.

clear_all_cookies is now deprecated because the name of a cookie
is no longer reliably sufficient to clear it.

Fixes tornadoweb#2911
@bdarnell bdarnell merged commit 0f8e10b into tornadoweb:master Jan 30, 2023
@bdarnell bdarnell deleted the cookie-updates branch January 30, 2023 19:17
bdarnell added a commit to bdarnell/tornado that referenced this pull request Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.
bdarnell added a commit to bdarnell/tornado that referenced this pull request Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.

Fixes tornadoweb#3252
bdarnell added a commit to bdarnell/tornado that referenced this pull request Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.

Fixes tornadoweb#3252
bdarnell added a commit to bdarnell/tornado that referenced this pull request Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.

Fixes tornadoweb#3252
bdarnell added a commit to bdarnell/tornado that referenced this pull request Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.

Fixes tornadoweb#3252
bdarnell added a commit to bdarnell/tornado that referenced this pull request Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.

Fixes tornadoweb#3252
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.

1 participant