FIX: force secure cookies on session if force https is enabled

This commit is contained in:
Sam
2016-10-27 15:15:58 +11:00
parent 004e71a3fe
commit 9848e26190
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,16 @@
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
if SiteSetting.force_https
cookie[:secure] = true
end
end
cookie_jar(request)[@key] = cookie
end
end