summaryrefslogtreecommitdiff
path: root/lib/rack/utils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rack/utils.rb')
-rw-r--r--lib/rack/utils.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb
index d541608a..1aee9d34 100644
--- a/lib/rack/utils.rb
+++ b/lib/rack/utils.rb
@@ -248,13 +248,20 @@ module Rack
rfc2822(value[:expires].clone.gmtime) if value[:expires]
secure = "; secure" if value[:secure]
httponly = "; HttpOnly" if (value.key?(:httponly) ? value[:httponly] : value[:http_only])
- first_party = "; First-Party" if value[:first_party]
+ same_site = if value[:same_site]
+ case value[:same_site]
+ when Symbol, String
+ "; SameSite=#{value[:same_site]}"
+ else
+ "; SameSite"
+ end
+ end
value = value[:value]
end
value = [value] unless Array === value
cookie = "#{escape(key)}=#{value.map { |v| escape v }.join('&')}#{domain}" \
- "#{path}#{max_age}#{expires}#{secure}#{httponly}#{first_party}"
+ "#{path}#{max_age}#{expires}#{secure}#{httponly}#{same_site}"
case header
when nil, ''