* Gets the cookie string to use for SameSite. This only sets the SameSite * value if specified, falling back to the browser default. The default value * is equivalent to SameSite_Enum.NONE, but is planned to be set to SameSite_Enum.LAX in * Chrome 80. * * Note: In Safari 12, if the value is set
(win, sameSite)
| 224 | * @return {string} The string to use when setting the cookie. |
| 225 | */ |
| 226 | function getSameSiteString(win, sameSite) { |
| 227 | if (!sameSite) { |
| 228 | return ''; |
| 229 | } |
| 230 | |
| 231 | return `; SameSite=${sameSite}`; |
| 232 | } |
| 233 | |
| 234 | /** |
| 235 | * Throws if a given cookie should not be set on the given origin. |