php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26316 Accessing remote php files (xml header) with xslt doesn't get session variables
Submitted: 2003-11-19 10:09 UTC Modified: 2003-11-27 14:21 UTC
From: andrew at shh dot fi Assigned:
Status: Closed Package: XSLT related
PHP Version: 4.3.3 OS: windows xp
Private report: No CVE-ID: None
 [2003-11-19 10:09 UTC] andrew at shh dot fi
Description:
------------
I've checked the bugs, searched google but no solution, except a work around.

Problem is this:

Create php page with XML header and create a session and store it in a tag. i.e <tag><? print $_SESSION["name"]?></tag>

Access it with the XSLT parser as a remote xml document (you need to of course) with a local XSL file. Parse it and the session is not there. 

This is probably because the XSLT parser is accessing the file from 'outside' and so the session has not been created. In my case its been create long before in the login script. 

The bug appears to be that the XSLT parser doesn't recognised the already created session. 

Is there a fix to this, perhaps a change in the XSLT function, etc.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-19 19:49 UTC] sniper@php.net
The obvious first thing that comes to my mind is that you're using short-tag there. ALWAYS use <?php ..and just disable 'short_open_tag' php.ini option.

If this didn't help, provide full testcase. (as short as possible)

 [2003-11-20 10:29 UTC] andrew at shh dot fi
You've missed the point here! Building XML documents using PHP doesn't matter whether the php tag starts with <? .. ?> pt <?php ...?> because the header funcion sends to the browser an xml header.  The problem is more to do with the fact that the xslt parser when parsing the document doesn't see it from server side but rather from a client side. 
I'll add a short demo shortly.
 [2003-11-27 14:21 UTC] andrew at shh dot fi
Problem resolved. Pack the session variables into one string and append to the fopen url. (Xslt_process requires 2 strings to parse or 2 local files. In order to pass 2 urls you need to read the url locations into a string) .On the other end unpack the session string into sessions and write out the xml.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 23:01:27 2024 UTC