• 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

Redirect to previous page with php

Add customer email and phone in "Order" column to admin orders list on Woocommerce

Jquery DataTables: Data not displaying in table via Ajax

How to install php_imagick on wamp64

Distribute array row data to make multiple new rows

json_encode turns array into an object

Form Validation and Submission to database

How to retrieve Active Directory group policy maximum password age using LDAP

Execute only one time and then wait set period of time before executing again

Explode not working properly with dash

GuzzleHttp Hangs When Using Localhost

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

Combining a describing and one array with data

Sum column values from multiple arrays

Show only featured products in Woocommerce shop page

About Contact Privacy policy Terms and conditions