• 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 create html table in php

Creating a config file in PHP

Unable to match results of php hash_hmac() and coldfusion hmac()

Can I write PHP code across multiple lines per statement?

Laravel Displaying image from database

GRPC installed successfully on ubuntu but php is looking for it in another folder

Edit XML in HTML form and submit to self

Laravel lang slug in url

How to insert data from multiple select dropdown values into database?

Correctly determine if date string is a valid date in that format

PHP error: "The zip extension and unzip command are both missing, skipping."

301 Redirect to remove query string on homepage only

Wordpress how to get the post thumbnail inside a figure tag

How can I create a Download Page with post php method?

Get lat/lon from google maps url ftid (hex)

About Contact Privacy policy Terms and conditions