Rails Session Stores

For reference, since it’s not specifically in the environment.rb file and apparently no one else on the net found it necessary to place on a Google-accessible page, the proper syntax for switching from file-based session stores to DRb session stores in Rails (0.14 and onwards) is config.action_controller.session_store = :drb_store inside the Rails::Initializer block.

From what I can tell, from the contents of the ActionPack’s lib/action_controller/session/ directory, the other options are :active_record_store and :mem_cache_store. This is actually confusing, since I thought the file store class would have been there, but it’s not.

Pair with one of our expert developers to level up your skills with Coaching by thoughtbot. Save time learning best practices and techniques for reducing technical debt in Ember, Ruby, Haskell, and Go in 1-on-1 sessions tailored to your goals.