2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2021-05-20 06:59:02 +00:00
|
|
|
class Session < ActiveRecord::SessionStore::Session
|
|
|
|
include Session::SetsPersistentFlag
|
2021-07-21 12:00:13 +00:00
|
|
|
|
|
|
|
def self.secure_flag?
|
|
|
|
# enable runtime change support in test/develop environments
|
|
|
|
return https? if !Rails.env.production?
|
|
|
|
|
|
|
|
@secure_flag ||= https?
|
|
|
|
rescue ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.https?
|
|
|
|
Setting.get('http_type') == 'https'
|
|
|
|
end
|
2021-05-20 06:59:02 +00:00
|
|
|
end
|