In Rails 6.0 and 6.1 the same_site
attribute has been added:
cookies["foo"] = {
value: "bar",
secure: Rails.application.config.secure_cookies,
same_site: "None"
}
For Rails 5.x and lower, the rails_same_site_cookie
gem is a good option for adding SameSite=None;
to all your app's cookies. It uses middleware to do it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…