• 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

How to use React Router with Laravel?

Set quantity minimum, maximum and step at product level in Woocommerce

Match csv filenames to table names and import

Converting IPv6 to IPv4 address in PHP

PHP Form Not Inserting

Pass a select with mysqli_fetch_row to a table

Laravel dosen't connect with Oracle

How to use functions that are declared in snippets in Evolution CMS (Modx) in an external PHP Script?

Unable to get password for the instance created from AMI

Laravel multi auth - Authentication user provider [] is not defined

Lumen - Postgresql setup - Composer

how to remove white space in select 2

Laravel Excel::store file empty after stored

Install mysql client in docker image

XSS attack still works despite htmlspecialchars() doing its work

About Contact Privacy policy Terms and conditions