aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorBrian Thomas Storti <btstorti@gmail.com>2014-02-27 23:39:58 -0800
committerBrian Thomas Storti <btstorti@gmail.com>2014-02-27 23:39:58 -0800
commit4b1639d8ea33d0a709900bfbb024a6fd6e587d86 (patch)
tree9effd62577b95c43637a3dfcc7ac997de306acaf /guides
parent544c78a4e964b1971c2409f4dc805f2d4161990e (diff)
downloadrails-4b1639d8ea33d0a709900bfbb024a6fd6e587d86.tar.gz
rails-4b1639d8ea33d0a709900bfbb024a6fd6e587d86.tar.bz2
rails-4b1639d8ea33d0a709900bfbb024a6fd6e587d86.zip
[ci skip] use secrets.yml instead of secret_token.rb in the action controller guide
Diffstat (limited to 'guides')
-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.