1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# Return the controller session secret for the current runtime environment. # Development and test environment secrets may optionally be hardcoded below. # For all other environments the secret must reside in the file config/session_secret.txt, # and that file should not be checked into the repository. begin secret = File(File(RAILS_ROOT, "config", "session_secret.txt")) rescue Errno => e raise e unless ['development','test'](RAILS_ENV) secret = 'your_hardcoded_secret_string' end secret end end Rails do |config| ... config = { :session_key => '_your_session_id_', :secret => SetupExtensions } end |

