• 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

Issue with laravel eloquent model property

Timber: Single post pagination does not work (wp_link_pages)

Laravel websockets AWS EC2 - Connection failed

How do I set the maximum php memory limit

Handle error for duplicate entries - PHP/MySQL

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

oauth-private.key does not exist or is not readable

Laravel relationship belongsToMany with composite primary keys

possible options to create pdf file using html elements to generate invoice in php and codeigniter

Phalcon: setStatusCode returns empty response

How can I stop a symfony process which is listening on http://127.0.0.1:8000

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

Laravel 5 issue with wherePivot

How can I get user id from session in javascript?

GuzzleHttp Hangs When Using Localhost

About Contact Privacy policy Terms and conditions