Module Web.Session
val find : ?cookie_key:string -> ?secret:string -> string -> Opium.Request.t -> string option
find ?cookie_key ?secret key request
returns the value that is associated to thekey
in the current session of therequest
.cookie_key
is the name of the session cookie. By default, the value is_session
.secret
is the secret used to sign the session cookie. By default,SIHL_SECRET
is used.
val set : ?cookie_key:string -> ?secret:string -> (string * string) list -> Opium.Response.t -> Opium.Response.t
set ?cookie_key ?secret data response
returns a response that hasdata
associated to the current session by setting the session cookie of the response.set
replaces the current session.cookie_key
is the name of the session cookie. By default, the value is_session
. If there is a session cookie already present it gets replaced.secret
is the secret used to sign the session cookie. By default,SIHL_SECRET
is used.