From 84df1bfeabe7228daee340fc438027269a0d6380 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 28 Apr 2023 14:01:15 +0100 Subject: [PATCH] Remove SessionCookieUpgrader from middleware This was a transitional bit of code to allow us to rename our session cookies without killing active sessions and logging users out. It's done it's job, the transition is finished, and it isn't doing anything useful now. It can be removed from the middleware stack. --- config/application.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/config/application.rb b/config/application.rb index 9672715eb4..15042715dc 100644 --- a/config/application.rb +++ b/config/application.rb @@ -34,15 +34,6 @@ end module Openfoodnetwork class Application < Rails::Application - config.middleware.insert_before( - ActionDispatch::Cookies, - SessionCookieUpgrader, { - old_key: "_session_id", - new_key: "_ofn_session_id", - domain: ".#{ENV['SITE_URL'].gsub(/^(www\.)|^(app\.)|^(staging\.)|^(stg\.)/, '')}" - } - ) if Rails.env.staging? || Rails.env.production? - config.after_initialize do # We need this here because the test env file loads before the Spree engine is loaded Spree::Core::Engine.routes.default_url_options[:host] = ENV["SITE_URL"] if Rails.env == 'test'