Genie.Cookies.get — Function.get(payload::Union{HTTP.Response,HTTP.Request}, key::Union{String,Symbol}, default::T; encrypted::Bool = true)::T where TAttempts 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 atkeyencrypted::Bool: iftruethe value stored on the cookie is automatically decrypted
get(res::HTTP.Response, key::Union{String,Symbol}) :: Nullable{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: iftruethe value stored on the cookie is automatically decrypted
get(req::Request, key::Union{String,Symbol}) :: Nullable{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: iftruethe value stored on the cookie is automatically decrypted
Genie.Cookies.get!! — Function.get!!(payload::Union{HTTP.Response,HTTP.Request}, key::Union{String,Symbol}; encrypted::Bool = true) :: StringRetrieves the cookie value stored at key within the payload object. Throws error if the key is not set.
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: iftruethe value stored on the cookie is automatically decrypted
Genie.Cookies.set! — Function.set!(res::HTTP.Response, key::Union{String,Symbol}, value::Any, attributes::Dict; encrypted::Bool = true) :: HTTP.ResponseSets value under the key label on the Cookie.
Arguments
res::HTTP.Response: the HTTP.Response objectkey::Union{String,Symbol}: the key for storing the cookie valuevalue::Any: the cookie valueattributes::Dict: additional cookie attributes, such asPathorHttpOnlyencrypted::Bool: iftruethe value is stored encoded
Base.Dict — Type.Dict([itr])Dict{K,V}() constructs a hash table with keys of type K and values of type V. Keys are compared with isequal and hashed with hash.
Given a single iterable argument, constructs a Dict whose key-value pairs are taken from 2-tuples (key,value) generated by the argument.
Examples
julia> Dict([("A", 1), ("B", 2)])
Dict{String,Int64} with 2 entries:
"B" => 2
"A" => 1Alternatively, a sequence of pair arguments may be passed.
julia> Dict("A"=>1, "B"=>2)
Dict{String,Int64} with 2 entries:
"B" => 2
"A" => 1Genie.Cookies.nullablevalue — Function.nullablevalue(payload::Union{HTTP.Response,HTTP.Request}, key::Union{String,Symbol}; encrypted::Bool = true)Attempts to retrieve a cookie value stored at key in the payload object and returns a Nullable{String}
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: iftruethe value stored on the cookie is automatically decrypted
Genie.Cookies.getcookies — Function.getcookies(req::HTTP.Request) :: Vector{HTTP.Cookies.Cookie}Extracts cookies from within req
getcookies(req::HTTP.Request) :: Vector{HTTP.Cookies.Cookie}Extracts cookies from within req, filtering them by matching name.