Module: ActionDispatch::RequestCookieMethods

Defined in:
lib/action_dispatch/middleware/cookies.rb

Instance Method Summary collapse

Instance Method Details



50
51
52
# File 'lib/action_dispatch/middleware/cookies.rb', line 50

def authenticated_encrypted_cookie_salt
  get_header Cookies::AUTHENTICATED_ENCRYPTED_COOKIE_SALT
end


13
14
15
16
17
# File 'lib/action_dispatch/middleware/cookies.rb', line 13

def cookie_jar
  fetch_header("action_dispatch.cookies") do
    self.cookie_jar = Cookies::CookieJar.build(self, cookies)
  end
end


30
31
32
# File 'lib/action_dispatch/middleware/cookies.rb', line 30

def cookie_jar=(jar)
  set_header "action_dispatch.cookies", jar
end

#cookies_digestObject



78
79
80
# File 'lib/action_dispatch/middleware/cookies.rb', line 78

def cookies_digest
  get_header Cookies::COOKIES_DIGEST
end

#cookies_rotationsObject



82
83
84
# File 'lib/action_dispatch/middleware/cookies.rb', line 82

def cookies_rotations
  get_header Cookies::COOKIES_ROTATIONS
end

#cookies_same_site_protectionObject



74
75
76
# File 'lib/action_dispatch/middleware/cookies.rb', line 74

def cookies_same_site_protection
  get_header(Cookies::COOKIES_SAME_SITE_PROTECTION)&.call(self)
end

#cookies_serializerObject



70
71
72
# File 'lib/action_dispatch/middleware/cookies.rb', line 70

def cookies_serializer
  get_header Cookies::COOKIES_SERIALIZER
end


58
59
60
# File 'lib/action_dispatch/middleware/cookies.rb', line 58

def encrypted_cookie_cipher
  get_header Cookies::ENCRYPTED_COOKIE_CIPHER
end


42
43
44
# File 'lib/action_dispatch/middleware/cookies.rb', line 42

def encrypted_cookie_salt
  get_header Cookies::ENCRYPTED_COOKIE_SALT
end


46
47
48
# File 'lib/action_dispatch/middleware/cookies.rb', line 46

def encrypted_signed_cookie_salt
  get_header Cookies::ENCRYPTED_SIGNED_COOKIE_SALT
end

Returns:

  • (Boolean)


26
27
28
# File 'lib/action_dispatch/middleware/cookies.rb', line 26

def have_cookie_jar?
  has_header? "action_dispatch.cookies"
end

#key_generatorObject



34
35
36
# File 'lib/action_dispatch/middleware/cookies.rb', line 34

def key_generator
  get_header Cookies::GENERATOR_KEY
end

#secret_key_baseObject



66
67
68
# File 'lib/action_dispatch/middleware/cookies.rb', line 66

def secret_key_base
  get_header Cookies::SECRET_KEY_BASE
end


62
63
64
# File 'lib/action_dispatch/middleware/cookies.rb', line 62

def signed_cookie_digest
  get_header Cookies::SIGNED_COOKIE_DIGEST
end


38
39
40
# File 'lib/action_dispatch/middleware/cookies.rb', line 38

def signed_cookie_salt
  get_header Cookies::SIGNED_COOKIE_SALT
end


54
55
56
# File 'lib/action_dispatch/middleware/cookies.rb', line 54

def use_authenticated_cookie_encryption
  get_header Cookies::USE_AUTHENTICATED_COOKIE_ENCRYPTION
end

#use_cookies_with_metadataObject



86
87
88
# File 'lib/action_dispatch/middleware/cookies.rb', line 86

def 
  get_header Cookies::USE_COOKIES_WITH_METADATA
end