Treat your sessions like models, not hashes. Intercession mixes a module into the session on each request, allowing you to nicely encapsulate (and test!) lots of user and session-specific behavior.
John Barnette
gem "intercession", "~> 3.0.0"