protected function prepareForUnserialization(string $data = null) : string
    {
        if ($data === null) {
            return '';
        }

        if ($this->usesEncryption) {
            if ($this->encrypter === null) {
                throw new LogicException('Encrypter not set on session handler');
            }

            try {
                return $this->encrypter->decrypt($data);
            } catch (SessionEncryptionException $ex) {
                return serialize([]);
            }
        } else {
            return $data;
        }
    }
protected function prepareForUnserialization(string $data = null) : string
    {
        if ($data === null) {
            return '';
        }

        if ($this->usesEncryption) {
            if ($this->encrypter === null) {
                throw new LogicException('Encrypter not set on session handler');
            }

            try {
                return $this->encrypter->decrypt($data);
            } catch (SessionEncryptionException $ex) {
                return serialize([]);
            }
        } else {
            return $data;
        }
    }
protected function prepareForUnserialization ( string $ data = null ) : string { if ( $ data === null ) { return '' ; } if ( $ this -> usesEncryption ) { if ( $ this -> encrypter === null ) { throw new LogicException ( 'Encrypter not set on session handler' ) ; } try { return $ this -> encrypter -> decrypt ( $ data ) ; } catch ( SessionEncryptionException $ ex ) { return serialize ( [ ] ) ; } } else { return $ data ; } }
Prepares data that is about to be unserialized

@param string|null $data The data to be unserialized
@return string The data to be unserializd
@throws LogicException Thrown if using encryption but an encrypter has not been set
Prepares data that is about to be unserialized