Skip to main content

Session information and local session management

Scope: SessionRpc (per-session operations tied to a Session) For an overview of RPC and the list of all RPC pages, see RPC.

metadata (experimental: session information)

Local session management (experimental)

Use $session->rpc()->management() to configure, list, create, message, and close local sessions that opted in to management in the same configuration directory. Register a host callback with setSessionCreationHandler() to receive the reverse RPC from create(). The callback must create the child session with newSessionId, keep its permission and model restrictions, and return a SessionManagementCreateResult. In the following example, $sessionCreationHandler is a closure that receives a SessionManagementCreateHostRequest, creates the child session on the host, and returns a SessionManagementCreateResult.
accepted from message() means the message was accepted for delivery, not that the target replied or finished its task. After you confirm separately that a child session finished its work, use close() to close only the children you created. Saved history isn’t deleted.
Last modified on November 19, 2026