class Athena::Framework::Spec::CookieJar
inherits Reference
#
Stores the cookies an ATH::Spec::AbstractBrowser received, sending the matching ones with its subsequent requests.
Cookies are matched against the domain, path, and scheme of the request, and are removed once they expire.
Methods#
#all_values(uri : URI) : Hash(String, String)#
Returns the name and value of the most specific cookie of each name that should be sent with a request to the provided uri.
#expire(name : String, path : String | Nil = "/", domain : String | Nil = nil) : Nil#
Removes the cookie with the provided name, path, and domain.
Removes it from all domains if domain is nil.
#get(name : String, path : String = "/", domain : String | Nil = nil) : ::HTTP::Cookie | Nil#
Returns the most specific cookie with the provided name that matches the provided path and domain, or nil if there is none.
#set(cookie : ::HTTP::Cookie) : Nil#
Stores the provided cookie, replacing any cookie with the same name, path, and domain.
#update_from_response(response : ::HTTP::Server::Response, uri : URI | Nil = nil) : Nil#
Stores the cookies set by the provided response.
Cookies without a domain or path default to those of the provided uri, and are ignored if they do not match its host.