mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-05 02:11:15 +08:00
19 lines
508 B
Ruby
19 lines
508 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ActionDispatch::Session::DiscourseCookieStore < ActionDispatch::Session::CookieStore
|
|
def initialize(app, options = {})
|
|
super(app, options)
|
|
end
|
|
|
|
private
|
|
|
|
def set_cookie(request, session_id, cookie)
|
|
if Hash === cookie
|
|
cookie[:secure] = true if SiteSetting.force_https
|
|
unless SiteSetting.same_site_cookies == "Disabled"
|
|
cookie[:same_site] = SiteSetting.same_site_cookies
|
|
end
|
|
end
|
|
cookie_jar(request)[@key] = cookie
|
|
end
|
|
end
|