• 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

MongoDB Duplicate Documents even after adding unique key

How to convert time from one timezone to another in PHP

Server-sent events in PHP (without echo or print)

Twig - How to check if variable is a number / integer

Laravel 5 session not persisting after user is logged in

Display specific shipping method if woocommerce product has specific acf field value

How to get the total hour from starting time to end time in php

If you intend you use SMTP, add your SMTP Code after this Line

how to search for a file with php

How can I pass the list to the component variable in Laravel?

Substitute integers and dots with regex [duplicate]

Facebook SDK error: Cross-site request forgery validation failed. Required param "state" missing from persistent data

PHP: Print caught exception like Xdebug

Populate Dynamic Dropdowns List in Codeigniter

SMTP "Error: DATA not accepted from server!" Opencart 2.3 on InMotionHosting

About Contact Privacy policy Terms and conditions