Class: Protocol::HTTP::Header::Cookie
- Defined in:
- lib/protocol/http/header/cookie.rb
Overview
The ‘cookie` header contains stored HTTP cookies previously sent by the server with the `set-cookie` header.
It is used by clients to send key-value pairs representing stored cookies back to the server.
Direct Known Subclasses
Instance Method Summary collapse
-
#to_h ⇒ Object
Parses the ‘cookie` header into a hash of cookie names and their corresponding cookie objects.
Methods inherited from Multiple
Constructor Details
This class inherits a constructor from Protocol::HTTP::Header::Multiple
Instance Method Details
#to_h ⇒ Object
Parses the ‘cookie` header into a hash of cookie names and their corresponding cookie objects.
19 20 21 22 23 24 25 |
# File 'lib/protocol/http/header/cookie.rb', line 19 def to_h = self.collect do |string| HTTP::Cookie.parse(string) end .map{|| [.name, ]}.to_h end |