This page is a translated version of the page Php-session-serializer and the translation is 11% complete.

php-session-serializer is a PHP library that provides methods that work like PHP's session_encode and session_decode functions but don't mess with the $_SESSION superglobal.


use Wikimedia\PhpSessionSerializer;

// (optional) Send logs to a PSR-3 logger
PhpSessionSerializer::setLogger( $logger );

// (optional) Ensure that session.serialize_handler is set to a usable value

// Encode session data
$string = PhpSessionSerializer::encode( $array );

// Decode session data
$array = PhpSessionSerializer::decode( $string );

Linki zewnętrzne