#38213 [Opn->Asn]: Wddx serializer and umlaute in $_SESSION variables don't work together

From: Date: Wed, 26 Jul 2006 08:50:26 +0000
Subject: #38213 [Opn->Asn]: Wddx serializer and umlaute in $_SESSION variables don't work together
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99902@lists.php.net to get a copy of this message
 ID:               38213
 Updated by:       tony2001@php.net
 Reported By:      wf at bitplan dot com
-Status:           Open
+Status:           Assigned
-Bug Type:         Reproducible crash
+Bug Type:         Session related
 Operating System: Windows XP
 PHP Version:      5.1.4
-Assigned To:      
+Assigned To:      ilia


Previous Comments:
------------------------------------------------------------------------

[2006-07-26 00:00:30] wf at bitplan dot com

Description:
------------
When setting the serialize handler to wddx in php.in:
session.serialize_handler = wddx
using any Umlaut in a $_SESSION variable will lead to misbehaviour of
the system e.g. Apache crashing or the session file content to be
destroyed

Reproduce code:
---------------
sesstest1.php:
=============
<?php
    session_start();
    $_SESSION['sess_var'] = "äöüßÄÖÜßé";
    session_write_close();
    echo "The content is ". $_SESSION['sess_var']. "<br />";
?>
<a href="sesstest2.php?<?php echo SID?>">Page 2 </a>
sesstest2.php:
=============
<?php
    session_start();
    echo "The content is ".$_SESSION['sess_var']."<br />";
    unset ($_SESSION['sess_var']);
    session_write_close();
?>
<a href="sesstest1.php?<?php echo SID?>">Page 1</a>

Expected result:
----------------
there are several ways to do this properly, one is to set the
encoding:
<?xml version="1.0" encoding="ISO-8859-1"?>
in the first line of the wddx file, another one is to use utf-8
encoding on encoding and decoding

Actual result:
--------------
<wddxPacket version='1.0'><header/><data><struct><var
name='sess_var'><string>äöüßÄÖÜßé</string></var></struct></data></wddxPacket>

And the system might throw-up on decoding when e.g. using french,
spanish, swedish or other accented characters.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38213&edit=1


Thread (3 messages)

« previous php.bugs (#99902) next »