mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
FIX: force secure cookies on session if force https is enabled
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user