class Loveline::Cookie
- Loveline::Cookie
- Reference
- Object
Included Modules
- YAML::Serializable
- YAML::Serializable::Strict
Defined in:
loveline/cookie.crConstant Summary
-
DAY_OF_MONTH =
/\A(?<day>\d\d?)#{NON_DIGIT}/
-
DELIMITER =
/[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]+/
-
NON_DIGIT =
/\z|\D/
-
TIME =
/\A(?<hour>\d\d?):(?<minute>\d\d?):(?<second>\d\d?)#{NON_DIGIT}/
-
YEAR =
/\A(?<year>\d{2,4})#{NON_DIGIT}/
Constructors
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(*, domain : String, path, name : String, value : String, creation_time : Time, last_access_time : Time, expiry : Time | Nil, secure : Bool, http_only : Bool, host_only : Bool)
Class Method Summary
- .domain_match?(*, request_host : String, cookie_domain : String) : Bool
- .from_headers(headers : HTTP::Headers, request_host : String, request_path : String, request_secure : Bool) : Array(Cookie)
- .parse_date(str : String) : Time | Nil
-
.parse_set_cookie_string(set_cookie_string : String, request_host : String, request_path : String, request_secure : Bool) : Cookie | Nil
The odd variable names in this method are taken directly from the algorithm specified in RFC6265 section 5.2: https://tools.ietf.org/html/rfc6265#section-5.2
- .path_match?(*, request_path : String, cookie_path : String) : Bool
-
.valid_hostname?(str : String) : Bool
This isn't a rigorous validity check.
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. - #creation_time : Time
- #domain : String
- #expired?(current_time : Time) : Bool
- #expiry : Time | Nil
- #host_only : Bool
- #http_only : Bool
- #last_access_time : Time
- #name : String
- #path : String
- #persistent?
- #secure : Bool
- #update_creation_time!(cookie_jar)
- #value : String
Constructor Detail
def self.new(*, domain : String, path, name : String, value : String, creation_time : Time, last_access_time : Time, expiry : Time | Nil, secure : Bool, http_only : Bool, host_only : Bool)
#
Class Method Detail
def self.from_headers(headers : HTTP::Headers, request_host : String, request_path : String, request_secure : Bool) : Array(Cookie)
#
def self.parse_set_cookie_string(set_cookie_string : String, request_host : String, request_path : String, request_secure : Bool) : Cookie | Nil
#
The odd variable names in this method are taken directly from the algorithm specified in RFC6265 section 5.2: https://tools.ietf.org/html/rfc6265#section-5.2
def self.valid_hostname?(str : String) : Bool
#
This isn't a rigorous validity check. I mostly just want to stop weird things happening if somebody makes a request to "..". https://www.ietf.org/rfc/rfc952.txt https://www.ietf.org/rfc/rfc1123.txt
Instance Method Detail
def ==(other : self)
#
Description copied from class Reference
Returns true
if this reference is the same as other. Invokes same?
.