Configure the hybrid cookie session store#302
Merged
bagedevimo merged 1 commit intomasterfrom Jun 11, 2025
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
cfeb9a9 to
6e0984f
Compare
This was referenced Jun 9, 2025
Merged
e155405 to
3bfbd7d
Compare
6e0984f to
d827e74
Compare
Holmes98
reviewed
Jun 10, 2025
|
|
||
| # Specify a serializer for the signed and encrypted cookie jars. | ||
| # Valid options are :json, :marshal, and :hybrid. | ||
| Rails.application.config.action_dispatch.cookies_serializer = :marshal |
Member
There was a problem hiding this comment.
Was this supposed to be :hybrid?
Contributor
Author
There was a problem hiding this comment.
No, I need to update the commit message I think instead. I wanted to add this file before the rails-5 change, then we can switch to hybrid later. I better go find the docs / changelog / recommendations again and check what versions have what options available. Please hold!
Contributor
Author
There was a problem hiding this comment.
Okay, I found better documentation, and I have updated the commit message to include links to that docs. We can (yay!) use hybrid now.
d827e74 to
5b4fdfa
Compare
5b4fdfa to
59d5cf3
Compare
Rails 4.1 introduced the new JSON format, and it becomes default in Rails 5.0. We want to be using hybrid in production for a period of time in order to migrate everyone to JSON before letting JSON be the default. Rails 7.0 changes the default to :json, but as long as we leave this initialiser in place we will continue to use hybrid. There are very very minor security concerns to allowing hybrid (and therefore marshall) but there are other tradeoffs to using :json, too. https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#cookies-serializer https://guides.rubyonrails.org/configuring.html#config-action-dispatch-cookies-serializer
59d5cf3 to
0e6fc42
Compare
Holmes98
approved these changes
Jun 11, 2025
Contributor
Author
Merge activity
|
This was referenced Jul 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Rails 4.1 introduced the new JSON format, and it becomes default in
Rails 5.0. We want to be using hybrid in production for a period of time
in order to migrate everyone to JSON before letting JSON be the default.
https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#cookies-serializer