• 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 insert dynamic input values with radio button

How to remove index.php and index from the URL using htaccess | PHP

PHP SoapClient: set a namespace without prefix

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

woocommerce get_order_report_data to show order_item_id

Reducing authentication calls on external API (Laravel 5.6)

PHP password_verify

Laravel Carbon throws error The format separator does not match

nginx err_connection_refused, can anyone help me?

WooCommerce: Add/display Product or Variation custom field everywhere

sort() not affecting original array while inside foreach loop

Custom API and cunsuming in php?

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

How can I get user id from session in javascript?

Cut an arabic string

About Contact Privacy policy Terms and conditions