session.rb 486 B

123456789101112131415161718
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Session < ActiveRecord::SessionStore::Session
  3. include Session::SetsPersistentFlag
  4. def self.secure_flag?
  5. # enable runtime change support in test/develop environments
  6. return https? if !Rails.env.production?
  7. @secure_flag ||= https?
  8. rescue ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid
  9. false
  10. end
  11. def self.https?
  12. Setting.get('http_type') == 'https'
  13. end
  14. end