discourse/lib/discourse_cookie_store.rb

Failed to ignore revisions in .git-blame-ignore-revs.

22 lines
526 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class ActionDispatch::Session::DiscourseCookieStore < ActionDispatch::Session::CookieStore
2017-07-27 21:20:09 -04:00
def initialize(app, options = {})
super(app, options)
end
private
def set_cookie(request, session_id, cookie)
if Hash === cookie
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
end