mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FEATURE: add support for same site cookies
Defaults to Lax, can be disabled or set to Strict. Strict will only work if you require login and use SSO. Otherwise when clicking on links to your site you will appear logged out till you refresh the page.
This commit is contained in:
parent
ad435da377
commit
ea1007e954
5 changed files with 42 additions and 3 deletions
|
@ -10,6 +10,9 @@ class ActionDispatch::Session::DiscourseCookieStore < ActionDispatch::Session::C
|
|||
if SiteSetting.force_https
|
||||
cookie[:secure] = true
|
||||
end
|
||||
unless SiteSetting.same_site_cookies == "Disabled"
|
||||
cookie[:same_site] = SiteSetting.same_site_cookies
|
||||
end
|
||||
end
|
||||
cookie_jar(request)[@key] = cookie
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue