Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve UpgradeSignatureToEncryptionCookieStore docs

I suck at English, please help me reviewing this <3 <3 <3
[ci skip]
  • Loading branch information...
commit d56cfadfe2c7547bbfd14b9e48ea484b35a53034 1 parent 5d239ac
@spastorino spastorino authored
View
15 actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
@@ -96,8 +96,21 @@ def cookie_jar(env)
# This cookie store helps you upgrading apps that use +CookieStore+ to the new default +EncryptedCookieStore+
#
- # To use this CookieStore set MyApp.config.session_store :upgrade_signature_to_encryption_cookie_store, key: '_myapp_session'
+ # To use this CookieStore use this
@rafaelfranca Owner

I think is better to use set instead of use this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ #
+ # Myapp::Application.config.session_store :upgrade_signature_to_encryption_cookie_store, key: '_myapp_session'
+ #
# in your config/initializers/session_store.rb
+ #
+ # You will also need to go to your config/initializers/secret_token.rb
@rafaelfranca Owner

You will also need to add

Myapp::Application.config.secret_key_base = 'some secret'

in your config/initializers/secret_token.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ #
+ # leave what you already had in your 3.2.x app
+ #
+ # Myapp::Application.config.secret_token = 'some secret'
+ #
+ # and also set secret_key_base to allow Rails to upgrade your users cookies
+ #
+ # Myapp::Application.config.secret_key_base = 'some secret'
class UpgradeSignatureToEncryptionCookieStore < EncryptedCookieStore
private

4 comments on commit d56cfad

@rafaelfranca

I think is better to use set instead of use this

@rafaelfranca

You will also need to add

Myapp::Application.config.secret_key_base = 'some secret'

in your config/initializers/secret_token.rb

@rafaelfranca

I think this text should be in the upgrading guide. What do you think?

@spastorino
Owner

Agree with everything bro, if you want to do it go ahead. If not I will do this soon :)

Please sign in to comment.
Something went wrong with that request. Please try again.