• 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

I can't delete my image when it is liked because of the foreign key in mysql

Encrypt in php and decrypt in Dart(flutter)

PHPS source file - 403 Forbidden You don't have permission to access this resource

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

How to add a sidebar to Woocommerce Shop Page?

Create a zip file and download it

Laravel Blade checkbox not checked

Only on Firefox "Loading failed for the <script> with source"

PHP7 CLI attempts to load xdebug twice - "Cannot load Xdebug - it was already loaded"

Shopify password update using Shopify API

auth pages not getting css in laravel

How to to send mail using gmail in Laravel?

Cant seem to get the Pagination to work on my WooCommerce REST API application?

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

protect images from being copied

About Contact Privacy policy Terms and conditions