• 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

Add customer email and phone in "Order" column to admin orders list on Woocommerce

How do I refresh a DIV content?

Move a child array to parent array and change parent/child name

How to install php yaml on CentOs?

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

How to debug in WooCommerce 3+

Having trouble with PDO queries (Notice: Undefined index)

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

Phalcon: setStatusCode returns empty response

How to get array values using foreach in laravel

Refresh specific HTML content that retrieves data from MySQL

Error converting docx to pdf using Unoconv

Add 2 Webcam in one page with WebcamJS

Display a product custom field only in WooCommerce Admin single orders

About Contact Privacy policy Terms and conditions