Genie.Cookies.get
— Functionget(payload::Union{HTTP.Response,HTTP.Request}, key::Union{String,Symbol}, default::T; encrypted::Bool = true)::T where T
Attempts to get the Cookie value stored at key
within payload
. If the key
is not set, the default
value is returned.
Arguments
payload::Union{HTTP.Response,HTTP.Request}
: the request or response object containing the Cookie headerskey::Union{String,Symbol}
: the name of the cookie valuedefault::T
: default value to be returned if no cookie value is set atkey
encrypted::Bool
: iftrue
the value stored on the cookie is automatically decrypted
get(res::HTTP.Response, key::Union{String,Symbol}) :: Union{Nothing,String}
Retrieves a value stored on the cookie as key
from the Respose
object.
Arguments
payload::Union{HTTP.Response,HTTP.Request}
: the request or response object containing the Cookie headerskey::Union{String,Symbol}
: the name of the cookie valueencrypted::Bool
: iftrue
the value stored on the cookie is automatically decrypted
get(req::Request, key::Union{String,Symbol}) :: Union{Nothing,String}
Retrieves a value stored on the cookie as key
from the Request
object.
Arguments
req::HTTP.Request
: the request or response object containing the Cookie headerskey::Union{String,Symbol}
: the name of the cookie valueencrypted::Bool
: iftrue
the value stored on the cookie is automatically decrypted