Rails Session Stores

Jon Yurek

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.

We've been helping engineering teams deliver exceptional products for over 20 years. Our designers, developers, and product managers work closely with teams to solve your toughest software challenges through collaborative design and development. Learn more about us.