Skip to content

Configure the hybrid cookie session store#302

Merged
bagedevimo merged 1 commit intomasterfrom
rails-4-1-session-store
Jun 11, 2025
Merged

Configure the hybrid cookie session store#302
bagedevimo merged 1 commit intomasterfrom
rails-4-1-session-store

Conversation

@bagedevimo
Copy link
Contributor

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

Copy link
Contributor Author

bagedevimo commented Jun 9, 2025

@coveralls
Copy link

coveralls commented Jun 9, 2025

Coverage Status

coverage: 37.578%. remained the same
when pulling 0e6fc42 on rails-4-1-session-store
into 8acb0ad on master.

@bagedevimo bagedevimo changed the base branch from master to graphite-base/302 June 9, 2025 02:37
@bagedevimo bagedevimo force-pushed the rails-4-1-session-store branch from cfeb9a9 to 6e0984f Compare June 9, 2025 02:37
@bagedevimo bagedevimo changed the base branch from graphite-base/302 to remove-strong-presenters June 9, 2025 02:37
@bagedevimo bagedevimo force-pushed the remove-strong-presenters branch from e155405 to 3bfbd7d Compare June 10, 2025 20:26
@bagedevimo bagedevimo force-pushed the rails-4-1-session-store branch from 6e0984f to d827e74 Compare June 10, 2025 20:27
@bagedevimo bagedevimo marked this pull request as ready for review June 10, 2025 20:28

# 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
Copy link
Member

Choose a reason for hiding this comment

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

Was this supposed to be :hybrid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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!

Copy link
Contributor Author

@bagedevimo bagedevimo Jun 11, 2025

Choose a reason for hiding this comment

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

Okay, I found better documentation, and I have updated the commit message to include links to that docs. We can (yay!) use hybrid now.

@bagedevimo bagedevimo changed the base branch from remove-strong-presenters to graphite-base/302 June 10, 2025 21:18
@bagedevimo bagedevimo force-pushed the rails-4-1-session-store branch from d827e74 to 5b4fdfa Compare June 10, 2025 21:18
@graphite-app graphite-app bot changed the base branch from graphite-base/302 to master June 10, 2025 21:18
@bagedevimo bagedevimo force-pushed the rails-4-1-session-store branch from 5b4fdfa to 59d5cf3 Compare June 10, 2025 21:18
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
@bagedevimo bagedevimo force-pushed the rails-4-1-session-store branch from 59d5cf3 to 0e6fc42 Compare June 11, 2025 02:22
@bagedevimo bagedevimo merged commit fe9146f into master Jun 11, 2025
7 checks passed
Copy link
Contributor Author

Merge activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants