cookies.rb 483 B

1234567891011121314151617
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'action_dispatch/middleware/cookies'
  3. module ActionDispatch
  4. class Cookies
  5. class CookieJar
  6. alias original_write_cookie? write_cookie?
  7. # https://github.com/rails/rails/blob/v6.0.4/actionpack/lib/action_dispatch/middleware/cookies.rb#L447-L449
  8. def write_cookie?(cookie)
  9. original_write_cookie?(cookie.merge(secure: ::Session.secure_flag?))
  10. end
  11. end
  12. end
  13. end