• 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

Laravel 5.2: Unable to locate factory with name [default]

Phalcon: setStatusCode returns empty response

Prestashop cUrl Login

Prestashop webservice API creating cart rules

Get number of working days between two dates in PHP [duplicate]

how to insert data into select2 search input after scan using qrcode

phpunit - testing is painfully slow

How to pass security cloudflare server with php curl

PHP: Convert any string to UTF-8 without knowing the original character set, or at least try

How to create a scheduler application in php

Telegram bot doesn't answer

How to downgrade or install a specific version of Composer?

Symfony 4: how to allow dynamic values for array nodes in bundle configuration?

XAMPP keeps showing Dashboard/Welcome Page instead of the Configuration Page

PHP: PDO + CSV export not downloading (headers issue?)

About Contact Privacy policy Terms and conditions