php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21268 session_decode does corretly the job, but returns FALSE !!!
Submitted: 2002-12-29 11:06 UTC Modified: 2002-12-29 12:51 UTC
From: JeanFrederic at Loiseau dot org Assigned:
Status: Closed Package: Session related
PHP Version: 4.2.3 OS: Windows XP
Private report: No CVE-ID:
 [2002-12-29 11:06 UTC] JeanFrederic at Loiseau dot org
I believed that session_decode was not working, because it was always returning false, BUT it works... even if it returns FALSE !

Here is my sample code :

<?php

session_start();

$_SESSION['test']=20;
echo "test = ".$_SESSION['test']."<br><br>";

$buffer=session_encode();
echo "buffer = ".$buffer."<br><br>";

$_SESSION['test']=10;
echo "test = ".$_SESSION['test']."<br><br>";

if (session_decode($buffer)==FALSE) echo "<br>It returns FALSE !!!!<br>";

echo "test = ".$_SESSION['test']."<br><br>";

?>

here is the ouput (after a REFRESH) :

test = 20
buffer = test|i:20;
test = 10
It returns FALSE !!!!
test = 20

It display "It returns FALSE", but $_SESSION['test'] is correctly initialized with 20 as it was...

Do I missed something ? or is it a bug ?

Thanks in advance,

Jean-Frederic

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-29 12:51 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 21:01:56 2014 UTC