Class: ActionDispatch::Cookies::SignedKeyRotatingCookieJar
- Inherits:
-
AbstractCookieJar
- Object
- AbstractCookieJar
- ActionDispatch::Cookies::SignedKeyRotatingCookieJar
- Includes:
- SerializedCookieJars
- Defined in:
- lib/action_dispatch/middleware/cookies.rb
Overview
:nodoc:
Constant Summary
Constants included from SerializedCookieJars
ActionDispatch::Cookies::SerializedCookieJars::SERIALIZER
Instance Method Summary collapse
-
#initialize(parent_jar) ⇒ SignedKeyRotatingCookieJar
constructor
A new instance of SignedKeyRotatingCookieJar.
Methods inherited from AbstractCookieJar
Methods included from ChainedCookieJars
#encrypted, #permanent, #signed, #signed_or_encrypted
Constructor Details
#initialize(parent_jar) ⇒ SignedKeyRotatingCookieJar
Returns a new instance of SignedKeyRotatingCookieJar.
605 606 607 608 609 610 611 612 613 614 615 |
# File 'lib/action_dispatch/middleware/cookies.rb', line 605 def initialize(parent_jar) super secret = request.key_generator.generate_key(request.) @verifier = ActiveSupport::MessageVerifier.new(secret, digest: , serializer: SERIALIZER) request..signed.each do |(*secrets)| = secrets. @verifier.rotate(*secrets, serializer: SERIALIZER, **) end end |