protected function serialize($data, int $lifetime) : string
    {
        return json_encode(
            ['d' => serialize($data), 't' => time() + $lifetime]
        );
    }
protected function serialize($data, int $lifetime) : string
    {
        return json_encode(
            ['d' => serialize($data), 't' => time() + $lifetime]
        );
    }
protected function serialize ( $ data , int $ lifetime ) : string { return json_encode ( [ 'd' => serialize ( $ data ) , 't' => time ( ) + $ lifetime ] ) ; }
Serializes the data with lifetime information

@param mixed $data The data to serialize
@param int $lifetime The lifetime in seconds
@return string The serialized data
Serializes the data with lifetime information