• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Why does codeigniter & Linux server throws unserialize() session data error when user tries to login

phplinuxcodeignitersession


PHP Snippet 1:

$recalculated_data = preg_replace_callback( '!s:(\d+):"(.*?)";!', function( $match ) {      
    return ( $match[1] == strlen( $match[2] ) ) ? $match[0] : 's:' . strlen( $match[2] ) . ':"' . $match[2] . '";';
}, $data );

unserialize( $recalculated_data );

Related Snippets

Error Class "LaravelFortifyFeatures" not found

PHP password_verify

Adding multiple items to WooCommerce cart at once

Magento 2 - Controller returning blank page

Store multiple fields in JSON column (Nova CMS)

Laravel 5.1 Unknown database type enum requested

Query Optimization, changing the queries in the loop into a single processing query

Laravel print last executed SQL query with Query log

How to get array values using foreach in laravel

"Unable to load dynamic library 'pdo_sqlsrv.so' "Cenos7 PHP7.2.10

yii2 and mssql insert varbinary into model

Changing font color in javascript

"cannot list resources" error from WooCommerce REST API

phpunit - mockbuilder - set mock object internal property

How to disable widget block editor of WordPress?

About Contact Privacy policy Terms and conditions