diff --git a/config/application.rb b/config/application.rb index 13aec8f..4e7a0f9 100644 --- a/config/application.rb +++ b/config/application.rb @@ -111,9 +111,7 @@ module Noosfero # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. config.secret_token = noosfero_session_secret - config.action_dispatch.session = { - :key => '_noosfero_session', - } + config.session_store :cookie_store, :key => '_noosfero_session' config.time_zone = File.read('/etc/timezone').split("\n").first config.active_record.default_timezone = :local diff --git a/vendor/plugins/noosfero_caching/init.rb b/vendor/plugins/noosfero_caching/init.rb index c786051..dd6dae2 100644 --- a/vendor/plugins/noosfero_caching/init.rb +++ b/vendor/plugins/noosfero_caching/init.rb @@ -49,11 +49,11 @@ module NoosferoHttpCaching # filter off all cookies except for plugin-provided ones that are # path-specific (i.e path != "/"). - def remove_unwanted_cookies(cookie_list) - return nil if cookie_list.nil? - cookie_list.select do |c| + def remove_unwanted_cookies(set_cookie) + return nil if set_cookie.nil? + set_cookie.split(/\s*,\s*/).select do |c| c =~ /^_noosfero_plugin_\w+=/ && c =~ /path=\/\w+/ - end + end.join(', ') end end @@ -61,7 +61,7 @@ module NoosferoHttpCaching end unless Rails.env.development? - middleware = Rails.application.config.middleware + middleware = Noosfero::Application.config.middleware ActionController::Base.send(:include, NoosferoHttpCaching) - middleware.use NoosferoHttpCaching::Middleware + middleware.insert_before ::ActionDispatch::Cookies, NoosferoHttpCaching::Middleware end -- libgit2 0.21.2