aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-02-22 00:57:02 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-02-22 00:57:02 +0000
commit5a1251dc2df7a3a1e4d6fec2e9085a464543ff50 (patch)
treed76efdb32d7074db5fea8c9298838ce78f0bf8da /railties
parent45dd256889cddd1a1746d122344a966873e03921 (diff)
downloadrails-5a1251dc2df7a3a1e4d6fec2e9085a464543ff50.tar.gz
rails-5a1251dc2df7a3a1e4d6fec2e9085a464543ff50.tar.bz2
rails-5a1251dc2df7a3a1e4d6fec2e9085a464543ff50.zip
Session configuration in config/environment.rb instead of app/controllers/application.rb
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6198 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r--railties/environments/environment.rb8
-rw-r--r--railties/helpers/application.rb5
2 files changed, 6 insertions, 7 deletions
diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb
index fe12591ded..e7526ab5e3 100644
--- a/railties/environments/environment.rb
+++ b/railties/environments/environment.rb
@@ -40,7 +40,11 @@ Rails::Initializer.run do |config|
# Make Active Record use UTC-base instead of local time
# config.active_record.default_timezone = :utc
-
+
+ # Your secret key for verifying cookie session data integrity.
+ # If you change this key, all old sessions will become invalid!
+ config.action_controller.session = { :secret => '<%= CGI::Session.generate_unique_id(app_name) %>' }
+
# See Rails::Configuration for more options
end
@@ -57,4 +61,4 @@ end
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register "application/x-mobile", :mobile
-# Include your application configuration below \ No newline at end of file
+# Include your application configuration below
diff --git a/railties/helpers/application.rb b/railties/helpers/application.rb
index c901717712..b61c6de386 100644
--- a/railties/helpers/application.rb
+++ b/railties/helpers/application.rb
@@ -2,9 +2,4 @@
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
- # Pick a unique cookie name to distinguish our session from others.
- # Session data is stored in a cookie by default, so the data is hashed
- # with a secret to ensure its integrity.
- session :session_key => '_<%= app_name %>_session',
- :secret => '<%= CGI::Session.generate_unique_id(app_name) %>'
end