• 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 increase the PHP upload limits [duplicate]

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

Symfony process run throws exception - executing on command line works

PHP drop down list using array's and foreach (else and for) code

SQL AVG() to 2 decimals

Getting values for an enum?

How avoid Moved Permanently The document has moved here

How to get total pages of PDF with FPDF?

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

OAuth2 Token PHP

Google Calendar API batch request PHP

Converting array to string and then back in PHP

PHP file_get_contents function

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

protect my blog content

About Contact Privacy policy Terms and conditions