• 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

Select option from dropdown menu with PHP and mySql

How to get monthly wise data in laravel

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'column_name' in Laravel

renameColumn migration fails for existing column with columns does not exist error

Send same name multiple checkbox values via ajax

How to redirect to another page and call a Function there on Angular ng-click

Applying programmatically a coupon to an Order in WooCommerce3

laravel MVC execution flow

How to validate tin and cst using PHP?

Symfony/Form add attribute based on the data

How do I call Validator from a namespace with an already existing Validator class

PHP usort() order in case of equality

OAuth2 Token PHP

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

insert multiple rows in a saveall in cakephp

About Contact Privacy policy Terms and conditions