Skip to content

Initial update of cookies/cookie_store to permit changing secret keys#18772

Closed
djmally wants to merge 4 commits intorails:masterfrom
djmally:master
Closed

Initial update of cookies/cookie_store to permit changing secret keys#18772
djmally wants to merge 4 commits intorails:masterfrom
djmally:master

Conversation

@djmally
Copy link
Copy Markdown

@djmally djmally commented Feb 1, 2015

cookies and cookie_store (should) now support changing secret keys without invalidating all cookies made with an old key. When an EncryptedCookieJar is created, it initializes a list of (secret_key, sign_secret)pairs, which is updated whenever the key is changed. Decrypting a cookie is achieved by checking the result of decrypting with every key stored, and validating the cookie if any of the decryptions do not fail.

@rafaelfranca
Copy link
Copy Markdown
Member

cc @jeremy

claudiob added a commit that referenced this pull request Feb 11, 2015
PR #18772 changed the parameters of `stale?` to use `kwargs`.
[As for this comment](https://github.com/rails/rails/pull/18872/files#r24456288)
the default value for the `etag` parameter should be `record`, not `nil`.

This commit fixes the code and introduces a test that:

- passed before #18872
- fails on the current master (after #18772)
- passes again after setting the default value of `etag` to `record`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djmally can you remove this extra line after the end. Thanks!

@dijonkitchen
Copy link
Copy Markdown
Contributor

Is this still relevant? Otherwise, it's stale and should be closed.

@rails-bot
Copy link
Copy Markdown

rails-bot bot commented Dec 18, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot unassigned sgrif Dec 18, 2019
@rails-bot rails-bot bot added the stale label Dec 18, 2019
@rails-bot rails-bot bot closed this Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants