• 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

Debugging Stripe Webhook Event

How to override header set in Apache config with more specific header in a virtual host

How to fix " Uncaught TypeError: Argument 1 passed to JpGraphException::defaultHandler() " problem in php 7.1.3 and jpgraph 4.2.6?

laravel 5.6 bulk inserting json data

Get latest Tweets - What API

Search for array row with specific column value and return another value from qualifying row

Invalid value in field "itemtype" in Google Search Console

Send Outlook 2010 email using PHP

PHP to search within txt file and echo the whole line

Display Link Title Instead of URL in XSL

Live search query using JS and PHP for QA forum

cakephp save drag and drop list order to database

Symfony - "framework.test" config is not set to true

Adding one microsecond to Datetime object in PHP

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

About Contact Privacy policy Terms and conditions