session_store.rb 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. #---
  2. # Excerpted from "Agile Web Development with Rails",
  3. # published by The Pragmatic Bookshelf.
  4. # Copyrights apply to this code. It may not be used to create training material,
  5. # courses, books, articles, and the like. Contact us if you are in doubt.
  6. # We make no guarantees that this code is fit for any purpose.
  7. # Visit http://www.pragmaticprogrammer.com/titles/rails4 for more book information.
  8. #---
  9. #---
  10. # Excerpted from "Agile Web Development with Rails, 4rd Ed.",
  11. # published by The Pragmatic Bookshelf.
  12. # Copyrights apply to this code. It may not be used to create training material,
  13. # courses, books, articles, and the like. Contact us if you are in doubt.
  14. # We make no guarantees that this code is fit for any purpose.
  15. # Visit http://www.pragmaticprogrammer.com/titles/rails4 for more book information.
  16. #---
  17. # Be sure to restart your server when you modify this file.
  18. # Your secret key for verifying cookie session data integrity.
  19. # If you change this key, all old sessions will become invalid!
  20. # Make sure the secret is at least 30 characters and all random,
  21. # no regular words or you'll be exposed to dictionary attacks.
  22. ActionController::Base.session = {
  23. :key => '_routing_session',
  24. :secret => 'd42e9f7b8e8a311c0a52e5a818645663aa0f1d8ea5f7eea74f1ed588194c28b0e947b8baf8aec03a7900d8bbc71997d16a4084a34a47ece16939cafc8df5a48e'
  25. }
  26. # Use the database for sessions instead of the cookie-based default,
  27. # which shouldn't be used to store highly confidential information
  28. # (create the session table with "rake db:sessions:create")
  29. # ActionController::Base.session_store = :active_record_store