set ?cookie_key ?secret data response returns a response that has data 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 with that name it gets replaced.
secret is the secret used to sign the session cookie. By default, SIHL_SECRET is used.
set_value ?cookie_key ?secret key value response returns a response with an updated session where key is associated with value. If key has no binding in the session, a new binding is added. Other bindings are not affected.
cookie_key is the name of the session cookie. By default, the value is _session.
If no session with name cookie_key is found, an error message is returned.
secret is the secret used to sign the session cookie. By default, SIHL_SECRET is used.
val update_or_set_value :
?cookie_key:string ->?secret:string ->key:string ->(string option->string option)->Response.t->Response.t
update_or_set_value ?cookie_key ?secret key f response returns a response with an updated session where a value associated with key is added, removed or updated by passing in the value to f. If key has no binding in the session, the input to f is None. If a binding a is found for key, the input to f is Some a. If f returns None, the binding for key is removed. Other bindings are not affected.
cookie_key is the name of the session cookie. By default, the value is _session. If there is no session cookie present, a new one is set and f None is added to the session.
secret is the secret used to sign the session cookie. By default, SIHL_SECRET is used.