• 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

Upgrade PHP on AWS Linux

In PHP, which is faster: preg_split or explode?

Move a child array to parent array and change parent/child name

Laravel eloquent update record without loading from database

Elasticsearch - Want to sort by field in all indices where that particular field available or not if not then avoid it

Printing more than one array using print_r or any other function in php

Cache clear probem in Larave

HTML and PHP in one file

how to check version of codeigniter framework?

Laravel PackageManifest.php: Undefined index: name

WooCommerce Subscriptions: Remove role on cancelled subscription

php curl requesting twice

PHP array stringify

PHP my timezone is no setting up in PHP.ini File in xampp

image source not readable

About Contact Privacy policy Terms and conditions