• 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

PHP each() function replacement

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

Getting error: CodeIgniterDatabaseBaseResult::getResult in CodeIgniter

HTML and PHP in one file

javascript html popup window

Laravel s3 upload file with metadata using pre-signed url

Getting error: CodeIgniterDatabaseBaseResult::getResult in CodeIgniter

How to get multiple values with same key from an array PHP

Return multiple values from a function using mysqli_fetch_assoc [closed]

Laravel Nova, route not found

Auto increment id JSON

dompdf and img tag, image wont show

PHP Slim Framework request using withAttribute error

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Limit login attempts in Laravel 5.7

About Contact Privacy policy Terms and conditions