class Cookie
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.
Definitions
def to_h
Parses the cookie
header into a hash of cookie names and their corresponding cookie objects.
Signature
-
returns
Hash(String, HTTP::Cookie)
a hash where keys are cookie names and values are
class Protocol::HTTP::Cookie
objects.
Implementation
def to_h
cookies = self.collect do |string|
HTTP::Cookie.parse(string)
end
cookies.map{|cookie| [cookie.name, cookie]}.to_h
end