• 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

Convert string to lowercase AND then convert it to its original form in PHP, is it possible?

How to edit Records using CodeIgniter

Laravel Jetsream Profile page not loading on fresh install

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

how can I set a session variable in Drupal 8 and get it in a php script?

Group data in a multidimensional array based on two columns

PHP web3 ERC20 token function call

is there any way to validate a field that sometime is File(image) && sometime is String(Src of same image)

Webscraping Symfony/Panther: Can't get HTML

PHPExcel_IOFactory::createWriter causes wrong behaviour

Laravel: Why is my variable not being set while it's in the construct function of the controller?

Group rows by column and sum another column within groups [duplicate]

Add New Parameter to Existing URL using htaccess

Inserting data into SQL Server Db An Invalid direction was specified

WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

About Contact Privacy policy Terms and conditions