• 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

Select option from dropdown menu with PHP and mySql

The "client_reference_id" argument is not passed

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

Not able to override collapsible.js in magento 2

WooCommerce Subscriptions: Remove role on cancelled subscription

Google Calendar API batch request PHP

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

Composer fails with kylekatarnls/update-helper on new homestead

How to add a custom field to all Woocommerce attribute terms using add_action

Combine multiple columns into an array as one of the key in a results set

PHP: How to raise number to (tiny) fractional exponent?

Doctrine ORM: Excluding Records Based on Values of Nested Relationships

Dropdown with current value from Mysql

Laravel query builder binding parameters more than once

Form Validation and Submission to database

About Contact Privacy policy Terms and conditions