From 96a00910d50931b139a1c00319b9fd46d863ca45 Mon Sep 17 00:00:00 2001 From: Drew Dara-Abrams Date: Wed, 1 Nov 2017 17:07:29 -0700 Subject: [PATCH] When no cache store is set use cookie storage for sessions A change in the default configuration of development environments in rails 5.1 means that caching is now disabled by default so in that case fall back to using cookies instead. Closes #1666 --- config/initializers/session_store.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 0f9e89970..8a0fd8f03 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -2,6 +2,8 @@ if defined?(MEMCACHE_SERVERS) Rails.application.config.session_store :mem_cache_store, :memcache_server => MEMCACHE_SERVERS, :namespace => "rails:session", :key => "_osm_session" -else +elsif Rails.application.config.cache_store != :null_store Rails.application.config.session_store :cache_store, :key => "_osm_session" +else + Rails.application.config.session_store :cookie_store, :key => "_osm_session" end -- 2.39.5