Add secure option to additional cookie (#8069)

signup-info-prompt
abcang 2018-07-26 01:49:47 +09:00 committed by Eugen Rochko
parent b62ec00d87
commit 69bf116345
1 changed files with 2 additions and 0 deletions

View File

@ -9,6 +9,7 @@ Warden::Manager.after_set_user except: :fetch do |user, warden|
value: session_id,
expires: 1.year.from_now,
httponly: true,
secure: (Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true'),
}
end
@ -18,6 +19,7 @@ Warden::Manager.after_fetch do |user, warden|
value: warden.cookies.signed['_session_id'] || warden.raw_session['auth_id'],
expires: 1.year.from_now,
httponly: true,
secure: (Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true'),
}
else
warden.logout