SpicyCode

The ramblings of Chad Humphries

Sessions keys and initializers oh my…

Rails revision 6198 added support for configuration of your session secret and key (following up to the cookie based session support recently added).

1   # Inside Rails::Initializer....
2   # Your secret key for verifying cookie session data integrity.
3   # If you change this key, all old sessions will become invalid!
4   config.action_controller.session = {
5     :session_key => '_<%= app_name %>_session',
6     :secret      => '<%= CGI::Session.generate_unique_id(app_name) %>'
7   }

Additionally support was added for a new folder config/initializers which is automatically loaded as part of the initialization process in 6212 and 6213.

The two example files given are config/initializers/inflections.rb and config/initializers/mime_types.rb.

I’m guess config/initializers was intended to simplify some of the config after_initialize code some apps have creeping into them requiring a variety of files.

Advertisements

Written by spicycode

February 23, 2007 at 5:01 pm

Posted in programming

Tagged with ,

%d bloggers like this: