//ads:
?>
Why does codeigniter & Linux server throws unserialize() session data error when user tries to login
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 );