aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/action_controller_overview.md
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-09-13 21:26:45 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2017-09-13 21:28:11 +0200
commitca18922ac23be2cde6963fae9b193c9111bec6f8 (patch)
tree395a1d4bd327a1b9638dc04df67827c8beffb9b8 /guides/source/action_controller_overview.md
parent9d7d75cab892f66db9a0173b78a9e1b901224066 (diff)
downloadrails-ca18922ac23be2cde6963fae9b193c9111bec6f8.tar.gz
rails-ca18922ac23be2cde6963fae9b193c9111bec6f8.tar.bz2
rails-ca18922ac23be2cde6963fae9b193c9111bec6f8.zip
[ci skip] Prefer credentials to secrets in docs.
Removes most mentions of secrets.secret_key_base and explains credentials instead. Also removes some very stale upgrade notices about Rails 3/4.
Diffstat (limited to 'guides/source/action_controller_overview.md')
-rw-r--r--guides/source/action_controller_overview.md30
1 files changed, 7 insertions, 23 deletions
diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md
index b3b5f19b61..2c3f74c3e1 100644
--- a/guides/source/action_controller_overview.md
+++ b/guides/source/action_controller_overview.md
@@ -397,34 +397,18 @@ You can also pass a `:domain` key and specify the domain name for the cookie:
Rails.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/secrets.yml`
+Rails sets up (for the CookieStore) a secret key used for signing the session data in `config/credentials.yml.enc`. This can be changed with `bin/rails credentials:edit`.
```ruby
-# Be sure to restart your server when you modify this file.
-
-# 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.
-# You can use `rails 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...
+# amazon:
+# access_key_id: 123
+# secret_access_key: 345
-# Do not keep production secrets in the repository,
-# instead read values from the environment.
-production:
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
+# Used as the base secret for all MessageVerifiers in Rails, including the one protecting cookies.
+secret_key_base: 492f...
```
-NOTE: Changing the secret when using the `CookieStore` will invalidate all existing sessions.
+NOTE: Changing the secret_key_base when using the `CookieStore` will invalidate all existing sessions.
### Accessing the Session