• 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

Nginx disallowing execution of PHP in uploads directory with Magento

Trying to iterate over a mongodb cursor twice - failing

How to upload mpdf file after generating to s3 bucket in php

Laravel phpunit test failing authorization

Statement that checks whether a URL contains a particular path?

PHP if in_array() how to get the key as well?

I need to link Google Sheet with my Laravel

How to test laravel controller method?

MOODLE: What does it mean to aggregate h5p assets?

How to modify CSS in a specific page of the WP admin dashboard (backend)

how to make my own auto increment in php?

Unable to get password for the instance created from AMI

Add Metadata, headers (Expires, CacheControl) to a file uploaded to Amazon S3 using the Laravel 5.0 Storage facade

Convert every two values of an associative array into key-value pairs

PHP's array_map including keys

About Contact Privacy policy Terms and conditions