Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #34780 : Serialize() and Sessions does not work properly
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 18th April 10:44
php-bugs
External User
 
Posts: 1
Default #34780 : Serialize() and Sessions does not work properly



From: pavel_bogdanovic at yahoo dot de
Operating system: winxp
PHP version: 5.0.5
PHP Bug Type: Session related
Bug description: Serialize() and Sessions does not work properly

Description:
------------
Situation: The session array key is the same like the var name.

After serialize() the argument is also serialized.


Reproduce code:
---------------
<?php
session_start();

$a[] = 'A';
$a[] = 'B';
$_SESSION['arr'] = $a;

echo '<pre>';
print_r($_SESSION['arr']);
$arr = serialize($_SESSION['arr']);
print_r($_SESSION['arr']);
echo '<br/>';
print_r($arr);
?>


Expected result:
----------------
Array
(
[0] => A
[1] => B
)
Array
(
[0] => A
[1] => B
)
a:2:{i:0;s:1:"A";i:1;s:1:"B";}

Actual result:
--------------
Array
(
[0] => A
[1] => B
)
a:2:{i:0;s:1:"A";i:1;s:1:"B";}
a:2:{i:0;s:1:"A";i:1;s:1:"B";}


--
Edit bug report at http://bugs.php.net/?id=34780&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34780&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34780&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34780&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34780&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34780&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34780&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34780&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34780&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34780&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34780&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34780&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34780&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34780&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34780&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34780&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34780&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34780&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34780&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34780&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34780&r=mysqlcfg
  Reply With Quote


  sponsored links


2 18th April 11:05
External User
 
Posts: 1
Default #34780 : Serialize() and Sessions does not work properly



ID: 34780
Updated by: johannes@php.net
Reported By: pavel_bogdanovic at yahoo dot de
-Status: Open
+Status: Bogus
Bug Type: Session related
Operating System: winxp
PHP Version: 5.0.5
New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the do***entation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Check your register_globals setting. If on
$_SESSION['arr'] and $arr refer to the same variable.


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

[2005-10-07 16:02:49] pavel_bogdanovic at yahoo dot de

Description:
------------
Situation: The session array key is the same like the var name.

After serialize() the argument is also serialized.


Reproduce code:
---------------
<?php
session_start();

$a[] = 'A';
$a[] = 'B';
$_SESSION['arr'] = $a;

echo '<pre>';
print_r($_SESSION['arr']);
$arr = serialize($_SESSION['arr']);
print_r($_SESSION['arr']);
echo '<br/>';
print_r($arr);
?>


Expected result:
----------------
Array
(
[0] => A
[1] => B
)
Array
(
[0] => A
[1] => B
)
a:2:{i:0;s:1:"A";i:1;s:1:"B";}

Actual result:
--------------
Array
(
[0] => A
[1] => B
)
a:2:{i:0;s:1:"A";i:1;s:1:"B";}
a:2:{i:0;s:1:"A";i:1;s:1:"B";}

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


--
Edit this bug report at http://bugs.php.net/?id=34780&edit=1
  Reply With Quote
3 18th April 11:07
php-bugs
External User
 
Posts: 1
Default #34780 : Serialize() and Sessions does not work properly


ID: 34780
User updated by: pavel_bogdanovic at yahoo dot de
Reported By: pavel_bogdanovic at yahoo dot de
Status: Bogus
Bug Type: Session related
Operating System: winxp
PHP Version: 5.0.5
New Comment:

wow, sorry for submitting no bug!


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

[2005-10-07 19:07:11] johannes@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the do***entation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Check your register_globals setting. If on
$_SESSION['arr'] and $arr refer to the same variable.

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

[2005-10-07 16:02:49] pavel_bogdanovic at yahoo dot de

Description:
------------
Situation: The session array key is the same like the var name.

After serialize() the argument is also serialized.


Reproduce code:
---------------
<?php
session_start();

$a[] = 'A';
$a[] = 'B';
$_SESSION['arr'] = $a;

echo '<pre>';
print_r($_SESSION['arr']);
$arr = serialize($_SESSION['arr']);
print_r($_SESSION['arr']);
echo '<br/>';
print_r($arr);
?>


Expected result:
----------------
Array
(
[0] => A
[1] => B
)
Array
(
[0] => A
[1] => B
)
a:2:{i:0;s:1:"A";i:1;s:1:"B";}

Actual result:
--------------
Array
(
[0] => A
[1] => B
)
a:2:{i:0;s:1:"A";i:1;s:1:"B";}
a:2:{i:0;s:1:"A";i:1;s:1:"B";}

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


--
Edit this bug report at http://bugs.php.net/?id=34780&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666