aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2014-02-28 12:50:58 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2014-02-28 12:50:58 -0500
commit6ef34603d2d05a81f2f556211d9eb1c0fbb7537e (patch)
tree9effd62577b95c43637a3dfcc7ac997de306acaf
parent544c78a4e964b1971c2409f4dc805f2d4161990e (diff)
parent4b1639d8ea33d0a709900bfbb024a6fd6e587d86 (diff)
downloadrails-6ef34603d2d05a81f2f556211d9eb1c0fbb7537e.tar.gz
rails-6ef34603d2d05a81f2f556211d9eb1c0fbb7537e.tar.bz2
rails-6ef34603d2d05a81f2f556211d9eb1c0fbb7537e.zip
Merge pull request #14231 from brianstorti/bs-docs-secret-token
Use secrets.yml instead of secret_token.rb in the docs
-rw-r--r--guides/source/action_controller_overview.md21
1 files changed, 18 insertions, 3 deletions
diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md
index 5b5f53c9be..1f9342ca25 100644
--- a/guides/source/action_controller_overview.md
+++ b/guides/source/action_controller_overview.md
@@ -381,16 +381,31 @@ You can also pass a `:domain` key and specify the domain name for the cookie:
YourApp::Application.config.session_store :cookie_store, key: '_your_app_session', domain: ".example.com"
```
-Rails sets up (for the CookieStore) a secret key used for signing the session data. This can be changed in `config/initializers/secret_token.rb`
+Rails sets up (for the CookieStore) a secret key used for signing the session data. This can be changed in `config/secrets.yml`
```ruby
# Be sure to restart your server when you modify this file.
-# Your secret key for verifying the integrity of signed cookies.
+# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
+
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-YourApp::Application.config.secret_key_base = '49d3f3de9ed86c74b94ad6bd0...'
+# You can use `rake secret` to generate a secure secret key.
+
+# Make sure the secrets in this file are kept private
+# if you're sharing your code publicly.
+
+development:
+ secret_key_base: a75d...
+
+test:
+ secret_key_base: 492f...
+
+# Do not keep production secrets in the repository,
+# instead read values from the environment.
+production:
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
```
NOTE: Changing the secret when using the `CookieStore` will invalidate all existing sessions.