• 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

Is there a way to use Foundry Model for Authentification inside Functional Tests?

How do I set the maximum php memory limit

Laravel: HTML in notification

Install mysql client in docker image

PHPMyAdmin not working as intended at remote server. Error 500, $respond not found

Clients authentication and user authentication with laravel

SQLSTATE[HY000]: General error: 1 table posts has no column named *

Sum array values

Get all WooCommerce products within own plugin

SMTP "Error: DATA not accepted from server!" Opencart 2.3 on InMotionHosting

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Can't call javascript alert alertify library from PHP

301 Redirect to remove query string on homepage only

Get latest Tweets - What API

httpd.conf on Windows: can't locate API model structure `php8_module`

About Contact Privacy policy Terms and conditions