class HTTP::Cookie
inherits Reference
¶
Represents a cookie with all its attributes. Provides convenient access and modification of them.
Class methods¶
.new(name : String, value : String, path : String? = nil, expires : Time? = nil, domain : String? = nil, secure : Bool = false, http_only : Bool = false, samesite : SameSite? = nil, extension : String? = nil)
¶
(name : String, value : String, path : String? = nil, expires : Time? = nil, domain : String? = nil, secure : Bool = false, http_only : Bool = false, samesite : SameSite? = nil, extension : String? = nil)
Creates a new Cookie
instance.
Raises IO::Error
if name or value are invalid as per RFC 6265 §4.1.1.
Methods¶
#==(other : self)
¶
(other : self)
Returns true
if this reference is the same as other. Invokes same?
.
#hash(hasher)
¶
(hasher)
#name=(name : String)
¶
(name : String)
Sets the name of this cookie.
Raises IO::Error
if the value is invalid as per RFC 6265 §4.1.1.
#value=(value : String)
¶
(value : String)
Sets the value of this cookie.
Raises IO::Error
if the value is invalid as per RFC 6265 §4.1.1.