|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20899 DOM Objects saved in current session can't be accessed after the initial page
Submitted: 2002-12-09 05:30 UTC Modified: 2002-12-09 05:36 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jalonso at art3mis dot com Assigned:
Status: Wont fix Package: DOM XML related
PHP Version: 4.3.0RC2 OS: Debian Linux 3.0
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-12-09 05:30 UTC] jalonso at art3mis dot com
Imagine this scenario: You load an XML file (with configuration data) into the current session along with some custom methods to change data in the XML object in memory to , finally, save your changes.

But actually you can't use DOM Methods like dump_mem() after registering your DOM object in the current session.

Try this script:


if (!isset($_SESSION['doc']))
  $_SESSION['doc'] = domxml_open_file('lalala.xml');

<a href="<?=$_SERVER['SCRIPT_NAME']?>">click</a>

lalala.xml is a valid xml file.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-09 05:36 UTC]
This is not possible and most presumably never will be possible. We would have to store the actual xml-data somewhere, but php knows only the pointer to the xml-data which is handled by the libxml2-library and this stuff gets freed after script-end.

you have to parse and save it everytime or use your own xml-structure built with php-objects, like maybe XML_Tree from PEAR (never tested that, though)

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 18:01:29 2024 UTC