Added support for SameSite cookies. by akash0x53 · Pull Request #409 · webpy/webpy

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@akash0x53

Copy link Copy Markdown

Contributor

@akash0x53 akash0x53 commented

Feb 21, 2017

edited

Loading

Good to mitigate against CSRF attacks. SameSite cookies are mentioned
in draft https://tools.ietf.org/html/draft-west-first-party-cookies-07

Fix for issue #410

@akash0x53

Copy link Copy Markdown

Contributor Author

@anandology Please review & comment.

@anandology

Copy link Copy Markdown

Member

@akash0x53 Did you notice my comment about string concatenation?

@akash0x53

Copy link Copy Markdown

Contributor Author

akash0x53 commented

Feb 27, 2017

edited

Loading

Nope. I can guess comment should be about this value += '; SameSite=' + samesite. Will use placeholder

morsel["httponly"] = True
value = morsel.OutputString()
if samesite and samesite.lower() in ['strict', 'lax']:
samesite_attr = "; SameSite=%s" % samesite
Copy link Copy Markdown

Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go? @anandology

@akash0x53

Copy link Copy Markdown

Contributor Author

SameSite support PR open for Django too.
https://github.com/django/django/pull/8380/files

@akash0x53

Copy link Copy Markdown

Contributor Author

Any update on this PR?

@jzellman

Copy link Copy Markdown

Contributor

👍 Looks good to me, @akash0x53 maybe squash down to a single commit?

iredmail added a commit that referenced this pull request

Sep 16, 2019
* Remove py2.3 support.
* Replace `attr in obj.keys()` by `attr in obj`.
* Set default cookie expire time to session timeout.
* Add support for SameSite cookie.

Fixes #521
Fixes #61 #99 #337
Fixes #409 #410

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@akash0x53 @anandology @jzellman