Skip to content

Commit

Permalink
When no cache store is set use cookie storage for sessions
Browse files Browse the repository at this point in the history
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 openstreetmap#1666
  • Loading branch information
drewda authored and tomhughes committed Nov 2, 2017
1 parent 236869e commit 96a0091
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config/initializers/session_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 96a0091

Please sign in to comment.