Class: ActionDispatch::Cookies::EncryptedCookieJar
- Inherits:
-
AbstractCookieJar
- Object
- AbstractCookieJar
- ActionDispatch::Cookies::EncryptedCookieJar
- Includes:
- SerializedCookieJars
- Defined in:
- lib/action_dispatch/middleware/cookies.rb
Overview
:nodoc:
Direct Known Subclasses
Constant Summary
Constants included from SerializedCookieJars
SerializedCookieJars::MARSHAL_SIGNATURE
Instance Method Summary collapse
-
#initialize(parent_jar) ⇒ EncryptedCookieJar
constructor
A new instance of EncryptedCookieJar.
Methods inherited from AbstractCookieJar
Methods included from ChainedCookieJars
#encrypted, #permanent, #signed, #signed_or_encrypted
Constructor Details
#initialize(parent_jar) ⇒ EncryptedCookieJar
Returns a new instance of EncryptedCookieJar.
571 572 573 574 575 576 577 578 579 580 581 582 |
# File 'lib/action_dispatch/middleware/cookies.rb', line 571 def initialize(parent_jar) super if ActiveSupport::LegacyKeyGenerator === key_generator raise "You didn't set secrets.secret_key_base, which is required for this cookie jar. " \ "Read the upgrade documentation to learn more about this new config option." end secret = key_generator.generate_key(request. || "")[0, ActiveSupport::MessageEncryptor.key_len] sign_secret = key_generator.generate_key(request. || "") @encryptor = ActiveSupport::MessageEncryptor.new(secret, sign_secret, digest: digest, serializer: ActiveSupport::MessageEncryptor::NullSerializer) end |