php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23757 name of session variable gets corrupted
Submitted: 2003-05-22 11:48 UTC Modified: 2003-05-22 16:32 UTC
From: tony at marston-home dot demon dot co dot uk Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.2RC4 OS: WindowsXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tony at marston-home dot demon dot co dot uk
New email:
PHP Version: OS:

 

 [2003-05-22 11:48 UTC] tony at marston-home dot demon dot co dot uk
In script #1 I want to store values in $_SESSION so that they will be available to script #2, so I use the script name as the key, as in
$_SESSION['option_enq.php'] = 'whatever';

When script #2 (option_enq.php) starts up it does session_start() then looks in $_SESSION for a value with its name. However, as of 4.3.2RC4 it cannot find it! I examined the contents of $_SESSION with my debugger and it showed me the key name had been changed to ';option_enq.php' - a semi-colon had been added in front.

I ran this through several times and I checked that before leaving the first script that $_SESSION contained the entry without the leading ';', but as soon as script #2 looks at the session array the name has been corrupted.

Here is a copy of the session data file:

expectedscript|s:14:"option_enq.php";prog_stack|a:1:{i:0;s:23:"/xample/option_list.php";}option_list.php|a:8:{s:12:"script_count";i:2;s:5:"where";N;s:9:"selection";N;s:6:"pageno";i:1;s:7:"orderby";N;s:5:"order";N;s:6:"search";N;s:9:"pkeyarray";a:10:{i:1;a:1:{s:9:"option_id";s:8:"ALBATROS";}i:2;a:1:{s:9:"option_id";s:8:"ALIGATOR";}i:3;a:1:{s:9:"option_id";s:8:"BARACUDA";}i:4;a:1:{s:9:"option_id";s:6:"BUMBLE";}i:5;a:1:{s:9:"option_id";s:8:"CHINCHIL";}i:6;a:1:{s:9:"option_id";s:8:"CROCODIL";}i:7;a:1:{s:9:"option_id";s:8:"DINOSAUR";}i:8;a:1:{s:9:"option_id";s:8:"DUCKBILL";}i:9;a:1:{s:9:"option_id";s:8:"ELEPHANT";}i:10;a:1:{s:9:"option_id";s:3:"EMU";}}}script_start|d:1053620791.8506410121917724609375;option_enq.php|a:2:{s:9:"selection";s:22:"(option_id='ALBATROS')";s:14:"orig_selection";s:22:"(option_id='ALBATROS')";}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-22 16:32 UTC] sniper@php.net
See bug #23761 which is about same issue. 
Add your comments there, please.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 13:01:30 2024 UTC