session_decode()

session_decode() — Decodes session data from a session encoded string.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

What it does

By default, the unserialization method used is internal to PHP, and is not the same as unserialize(). The serialization method can be set using session.serialize_handler.

Signature

session_decode(string $data): bool

Parameters

ParameterTypeWhat it takes
$datastringThe encoded data to be stored.

Return value

Returns true on success or false on failure.

Example

The PHP manual ships no example for session_decode(); the signature and the parameter table above are the contract.

See also

session_encode()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page session_decode() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.