2019-05-03 08:17:27 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
# Be sure to restart your server when you modify this file.
|
|
|
|
|
2022-03-21 15:28:52 +01:00
|
|
|
Rails.application.config.session_store(
|
2016-10-27 15:15:58 +11:00
|
|
|
:discourse_cookie_store,
|
2016-03-07 13:40:14 -05:00
|
|
|
key: "_forum_session",
|
|
|
|
path:
|
2023-01-07 11:59:28 +00:00
|
|
|
(
|
2016-03-07 13:40:14 -05:00
|
|
|
if (Rails.application.config.relative_url_root.nil?)
|
2023-01-07 11:59:28 +00:00
|
|
|
"/"
|
|
|
|
else
|
2016-03-07 13:40:14 -05:00
|
|
|
Rails.application.config.relative_url_root
|
2023-01-07 11:59:28 +00:00
|
|
|
end
|
|
|
|
),
|
2016-03-07 13:40:14 -05:00
|
|
|
)
|
2022-03-21 15:28:52 +01:00
|
|
|
|
|
|
|
Rails.application.config.to_prepare do
|
2024-03-27 10:48:04 +11:00
|
|
|
if Rails.env.development? && SiteSetting.force_https && !ENV["DISCOURSE_DEV_ALLOW_HTTPS"]
|
2022-03-21 15:28:52 +01:00
|
|
|
STDERR.puts
|
|
|
|
STDERR.puts "WARNING: force_https is enabled in dev"
|
|
|
|
STDERR.puts "It is very unlikely you are running HTTPS in dev."
|
|
|
|
STDERR.puts "Without HTTPS your session cookie will not work"
|
|
|
|
STDERR.puts "Try: bin/rails c"
|
|
|
|
STDERR.puts "SiteSetting.force_https = false"
|
|
|
|
STDERR.puts
|
|
|
|
end
|
|
|
|
end
|