Genie.Sessions.Session — Type.mutable struct SessionRepresents a session object
Genie.Sessions.id — Function.id() :: StringGenerates a new session id.
id(payload::Union{HTTP.Request,HTTP.Response}) :: StringAttempts to retrieve the session id from the provided payload object. If that is not available, a new session id is created.
id(req::HTTP.Request, res::HTTP.Response) :: StringAttempts to retrieve the session id from the provided request and response objects. If that is not available, a new session id is created.
Genie.Sessions.start — Function.start(session_id::String, req::HTTP.Request, res::HTTP.Response; options = Dict{String,String}()) :: SessionInitiates a new HTTP session with the provided session_id.
Arguments
session_id::String: the id of the session objectreq::HTTP.Request: the request objectres::HTTP.Response: the response objectoptions::Dict{String,String}: extra options for setting the session cookie, such asPathandHttpOnly
start(req::HTTP.Request, res::HTTP.Response; options::Dict{String,String} = Dict{String,String}()) :: SessionInitiates a new default session object, generating a new session id.
Arguments
req::HTTP.Request: the request objectres::HTTP.Response: the response objectoptions::Dict{String,String}: extra options for setting the session cookie, such asPathandHttpOnly
Genie.Sessions.set! — Function.set!(s::Session, key::Symbol, value::Any) :: SessionStores value as key on the Session object s.
Genie.Sessions.get — Function.get(s::Session, key::Symbol) :: NullableReturns the value stored on the Session object s as key, wrapped in a Nullable.
get(s::Session, key::Symbol, default::T) :: T where TAttempts to retrive the value stored on the Session object s as key. If the value is not set, it returns the default.
Genie.Sessions.get!! — Function.get!!(s::Session, key::Symbol)Attempts to read the value stored on the Session s as key - throws an exception if the key is not set.
Genie.Sessions.unset! — Function.unset!(s::Session, key::Symbol) :: SessionRemoves the value stored on the Session s as key.
Genie.Sessions.isset — Function.isset(s::Session, key::Symbol) :: BoolChecks wheter or not key exists on the Session s.
Genie.Sessions.session — Function.session(params::Dict{Symbol,Any}) :: Sessions.SessionReturns the Session object associated with the current HTTP request.