• 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

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

Laravel UUID generation

OAuth2 Token PHP

PHP Sorting - getting 10, 11, 12 ... 1, 20, 2 rather than 1, 10, 11, 12 ... 2, 20

How to get page number on dompdf PDF when using "view"

How to get AJAX to post on second page?

How to get transaction details in notify_url page in paypal

Clear javascript source cache laravel 5.8

CodeIgniter force_download is not working

WAMP Virtual Host not working

dompdf and img tag, image wont show

Log a user out of a website when they put their computer to sleep

Multiply each value in array using array_map function

How to keep value of selected value after form submission?

How to convert a carbon into string, to take the date only?

About Contact Privacy policy Terms and conditions