• 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

sort() not affecting original array while inside foreach loop

CodeIgniter force_download is not working

Correct way to use LIKE '%{$var}%' with prepared statements?

php curl requesting twice

How do I do HTTP basic authentication using Guzzle?

How to set time with DateTime modify?

PHP password_verify

Get image type from base64 encoded src string

Not able to override collapsible.js in magento 2

Laravel UUID generation

PHP Warning: Module already loaded in Unknown on line 0

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

Losing session data after POST from third party website

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

how to use extended ASCII instead of unicode in PHP

About Contact Privacy policy Terms and conditions