Add support for Cookie SameSite attribute#641
Merged
schloerke merged 5 commits intorstudio:masterfrom Aug 12, 2020
Merged
Conversation
added 2 commits
August 10, 2020 12:53
Allows the SameSite attribute to be set on cookies. This is especially important for Cross-Origin requests, as in the near future browsers will automatically default to the "SameSite=Lax" policy for cookies without an explicit policy set. This will prevent cookies from being sent on Cross-Origin requests unless the policy is set to "None". See: https://www.chromestatus.com/feature/5088147346030592 https://www.chromestatus.com/feature/5633521622188032
Adds `sameSite` parameter to `pr_cookie()`. Adds additional tests. Adds entry to NEWS.md.
schloerke
requested changes
Aug 11, 2020
The sessionCookie() function now checks that the value of sameSite is one of the 3 allowed values. If sameSite is set to None and secure is FALSE, an error will be emitted.
schloerke
reviewed
Aug 11, 2020
schloerke
reviewed
Aug 11, 2020
Collaborator
|
Thank you @chris-dudley ! Once I get |
jcheng5
approved these changes
Aug 12, 2020
Member
jcheng5
left a comment
There was a problem hiding this comment.
Thank you for the contribution @chris-dudley!
schloerke
approved these changes
Aug 12, 2020
schloerke
reviewed
Aug 12, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an optional
sameSiteattribute to the following functions:sessionCookie()pr_cookie()res$setCookie()res$removeCookie()removeCookieStrcookieToStrIf set to a character value
<value>, the generated cookie will contain aSameSite=<value>attribute.Fixes #640
Allows the SameSite attribute to be set on cookies. This is especially important for Cross-Origin requests, as in the near future browsers will automatically default to the "SameSite=Lax" policy for cookies without an explicit policy set. This will prevent cookies from being sent on Cross-Origin requests unless the policy is set to "None".
See: