• 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 Discord OAUTH2 code sample not working

Check if user online laravel

array_key_exists(): The first argument should be either a string or an integer

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

PHP Download MP3 files from directory on server

Laravel Passport - Not able to get token string in response?

Python - Include another Python script

How to load Codeigniter 4 lang file into an array variable

How to extract price from given url using Xpath?

How to insert Google Adsense Code in PHP script?

Trying to iterate over a mongodb cursor twice - failing

Target class controller does not exist - Laravel 8

Laravel 8 Multiple Relationships for Factory

how to youtube api data to print in toolset metabox using a button click before save-post

PHP array slice from position + attempt to return fixed number of items

About Contact Privacy policy Terms and conditions