object
http_server_core_session
Server-side HTTP session manager over normalized request and response terms using opaque cookie identifiers and an in-memory session store.
logtalk_load(http_session(loader))static, context_switching_callsPublic predicates
open/1
Opens a new server-session manager using the default cookie and timeout options.
staticopen(Manager)open(-compound) - one_or_erroropen/2
Opens a new server-session manager using the given cookie, timeout, and store options.
staticopen(Manager,Options)open(-compound,+list(compound)) - one_or_errorOptions is a variable or a partial list:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)close/1
Closes a server-session manager and discards all in-memory request contexts and stored sessions owned by it.
staticclose(Manager)close(+compound) - one_or_errorManager is a variable:instantiation_errorManager is neither a variable nor an open server-session manager handle:domain_error(http_server_core_session,Manager)begin/3
Begins server-session processing for a normalized request, annotating it with a per-request session handle and the current session state.
staticbegin(Manager,Request,AnnotatedRequest)begin(+compound,+compound,-compound) - one_or_errorManager is a variable:instantiation_errorManager is neither a variable nor an open server-session manager handle:domain_error(http_server_core_session,Manager)Request is not a valid normalized HTTP request:domain_error(http_server_core_session_request,Request)finish/3
Finishes server-session processing for an annotated normalized request and a normalized response, adding any needed Set-Cookie lifecycle properties.
staticfinish(Request,Response0,Response)finish(+compound,+compound,-compound) - one_or_errorRequest is not a valid annotated server-session request:domain_error(http_server_core_session_request,Request)Response0 is not a valid normalized HTTP response:domain_error(http_server_core_session_response,Response0)domain_error(http_header_semantics,Header)current/2
Returns the request-bound current server-session handle from an annotated normalized request.
staticcurrent(Request,Session)current(+compound,-compound) - one_or_errorRequest is not a valid annotated server-session request:domain_error(http_server_core_session_request,Request)ensure/2
Ensures that the annotated request has a backing stored server session and returns its request-bound handle.
staticensure(Request,Session)ensure(+compound,-compound) - one_or_errorRequest is not a valid annotated server-session request:domain_error(http_server_core_session_request,Request)data/2
Returns the current session key-value data pairs for a request-bound server-session handle or [] when no backing session exists yet.
staticdata(Session,Data)data(+compound,-list(compound)) - one_or_errorSession is a variable:instantiation_errorSession is not a valid request-bound server-session handle:domain_error(http_server_core_session_handle,Session)get/3
Returns the current value for a session data key from a request-bound server-session handle.
staticget(Session,Key,Value)get(+compound,+term,-term) - zero_or_oneset/3
Sets or replaces a session data key-value pair, creating a backing stored session when needed.
staticset(Session,Key,Value)set(+compound,+term,+term) - one_or_errorSession is a variable:instantiation_errorSession is not a valid request-bound server-session handle:domain_error(http_server_core_session_handle,Session)remove/3
Removes a session data key-value pair and returns its previous value.
staticremove(Session,Key,Value)remove(+compound,+term,-term) - zero_or_onedestroy/1
Destroys the backing stored session, causing finish/3 to emit a deletion cookie when applicable.
staticdestroy(Session)destroy(+compound) - one_or_errorSession is a variable:instantiation_errorSession is not a valid request-bound server-session handle:domain_error(http_server_core_session_handle,Session)renew/2
Renews the backing stored session identifier and returns the new opaque cookie identifier.
staticrenew(Session,NewIdentifier)renew(+compound,-atom) - one_or_errorSession is a variable:instantiation_errorSession is not a valid request-bound server-session handle:domain_error(http_server_core_session_handle,Session)gc/2
Performs opportunistic garbage collection of expired stored sessions for the given manager and returns the number collected.
staticgc(Manager,Collected)gc(+compound,-integer) - one_or_errorManager is a variable:instantiation_errorManager is neither a variable nor an open server-session manager handle:domain_error(http_server_core_session,Manager)count/2
Returns the number of currently stored sessions owned by the given manager.
staticcount(Manager,Count)count(+compound,-integer) - one_or_errorManager is a variable:instantiation_errorManager is neither a variable nor an open server-session manager handle:domain_error(http_server_core_session,Manager)Protected predicates
http_server_core_session_event/2
Optional overridable hook predicate called with server-session lifecycle events.
statichttp_server_core_session_event(Manager,Event)http_server_core_session_event(+compound,+compound) - zero_or_onePrivate predicates
manager_seed_/1
Last allocated server-session manager identifier.
dynamicmanager_seed_(ManagerId)manager_seed_(?positive_integer) - zero_or_onemanager_state_/2
Per-manager cookie, timeout, and garbage-collection state.
dynamicmanager_state_(ManagerId,State)manager_state_(?positive_integer,?compound) - zero_or_morecontext_seed_/1
Last allocated request context identifier.
dynamiccontext_seed_(ContextId)context_seed_(?positive_integer) - zero_or_onecontext_state_/2
Per-request server-session context state.
dynamiccontext_state_(ContextId,Context)context_state_(?positive_integer,?compound) - zero_or_morestored_session_/6
Stored server-session data entries owned by a manager.
dynamicstored_session_(ManagerId,SessionId,Data,CreatedAt,LastSeenAt,AbsoluteExpiryAt)stored_session_(?positive_integer,?atom,?list(compound),?non_negative_integer,?non_negative_integer,?nonvar) - zero_or_moreOperators
(none)