• 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

Laravel Jetsream Profile page not loading on fresh install

How to insert data from multiple select dropdown values into database?

Can't exclude directories from .htaccess mobile redirect?

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

mysql_result is defined but mysql_free_result warns it expected a resource

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

How to edit Records using CodeIgniter

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

Get orders by date and status woocommerce

Laravel Model save() & update() Not Saving

OctoberCMS / Anonymous Global Scope

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

Read users and passwords from a txt file

CodeIgniter 4: Like and Dislike Functionality

Display Link Title Instead of URL in XSL

About Contact Privacy policy Terms and conditions