Manual:Hooks/SessionMetadata

Details

 * $backend: being saved.
 * &$metadata: Array of metadata to be stored. Add new keys here. Must be serializable.
 * $requests: Array of potentially being saved to. Generally 0-1 real request and 0+.

Allows adding extra metadata to the session. The metadata can be used to invalidate the session via the hook (e.g. to tie sessions to IPs, one could add the IP address in SessionMetadata and check it against the actual IP address of the request in SessionCheckInfo). Changing existing keys is not allowed.

A adding metadata for its own session does not need this hook; it should instead pass the metadata to the SessionInfo constructor, or call , or use its   or   methods (which will be called on every request) to update existing metadata.