• 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

Sliders in Laravel

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

How to add class name to an existing tag in php

How to change the app environment at run time?

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

How to use $this->session->set_userdata in codeigniter

Redis Command To Sort Keys

500 (Internal Server Error) with Laravel & Docker [duplicate]

How to break out of a foreach once a condition is met?

How to change product Image when variables are selected in Shop and Archive Pages?

PHP drop down list using array's and foreach (else and for) code

Can I use a WooCommerce function without any WooCommerce page?

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

Laravel 8 Multiple Relationships for Factory

Adding reCAPTCHA v2 into my PHP file

About Contact Privacy policy Terms and conditions