• 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 Excel::store file empty after stored

Form Validation and Submission to database

Inserting data into SQL Server Db An Invalid direction was specified

Insert database rows from columns of data from associative array of indexed arrays

add " ? " in url via htaccess RewriteRule

SlimExceptionHttpNotFoundException

Laravel database insert with combining array and string

Doctrine 2 mapping referencing unique key

Unable to get password for the instance created from AMI

WooCommerce: Add/display Product or Variation custom field everywhere

JSON Render Issue in Date Object Laravel and PHP 7.4

Store / Website Column in Magento 2 Admin Grid - Custom Module

How to make Canonicals with PHP

Laravel lang slug in url

How to keep value of selected value after form submission?

About Contact Privacy policy Terms and conditions