php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34746 SOAP_PERSISTENCE_SESSION no longer works
Submitted: 2005-10-06 00:35 UTC Modified: 2005-11-02 14:15 UTC
From: brent at jeneral dot com Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.0.5 OS: Freebsd 5.4
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: brent at jeneral dot com
New email:
PHP Version: OS:

 

 [2005-10-06 00:35 UTC] brent at jeneral dot com
Description:
------------
Soap persistent sessions (SOAP_PERSISTENCE_SESSION) no longer works in version 5.05 (php5-soap-5.0.5). Downgrading to previous 5.0.4_2 works.

I created a test script that also verified the bug below:

Reproduce code:
---------------
Server Code:
$soap = new SoapServer("sessionTestServer.wsdl");
$soap->setClass("sessionTestServer");
$soap->setPersistence(SOAP_PERSISTENCE_SESSION);
$soap->handle();

Class:
class sessionTestServer {
private $count = 0;
	public function count() {
		$this->count++;
		return $this->count;
	}
}

Client:
echo "<br>Count: ".$client->count();	// Should be 1
echo "<br>Count: ".$client->count();	// Should be 2
echo "<br>Count: ".$client->count();	// Should be 3

Expected result:
----------------
Should be 1, 2, 3 but is 1, 1, 1. Session variables are not persistent.

Actual result:
--------------
Should be 1, 2, 3 but is 1, 1, 1. Session variables are not persistent.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-06 00:47 UTC] tony2001@php.net
Please provide the .wsdl file too.
 [2005-10-06 01:51 UTC] brent at jeneral dot com
The whole test script:
http://www.jeneral.com/sessionTest.zip
 [2005-10-12 09:42 UTC] brent at jeneral dot com
I do not have the right patches to sucessfully compile the "latest" version on FreeBSD.  Does anyone out there have the right files or have successfully done it?  Without the patches, it appears to compile; however, the soap routines are not available.

As another reference point, all of my FreeBSD servers running 5.0.5 fail the soap test script.
 [2005-10-12 12:21 UTC] tony2001@php.net
What patches are you talking about?
SOAP support requires only --enable-soap configure option.
 [2005-10-13 00:03 UTC] brent at jeneral dot com
FreeBSD's ports system uses patches to implement the products in it's framework.  For some reason I cannot compile and integrate the "lastest" version.
 [2005-10-13 00:11 UTC] tony2001@php.net
Actually sniper asked you to try the certain snapshot, not some "ports". Please do so.
I'm not asking to do 'make install', btw.
You can build it in your own directory and replace libphp5.so for 5 mins just to test it.
I can't reproduce it, so I suspect it's already fixed, but I need you to comfirm it to be sure.
 [2005-10-13 08:19 UTC] ale at FreeBSD dot org
I think the problem is this: in soap.c you changed all the following rows

#if HAVE_PHP_SESSION

with

#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)

In FreeBSD all extensions are dinamically loaded, so the persistence session support cannot work anymore. Moreover, in FreeBSD, extensions can use code provided by other shared extensions (like session.so in this case), so this check is actually a limitation for us.
 [2005-10-13 10:55 UTC] tony2001@php.net
I don't get how changing this line can help to fix the problem.
Imagine that you've build PHP with SOAP enabled and after that you've additionally built session module.
Both of them would be available, but SOAP wouldn't know about session.

>In FreeBSD all extensions are dinamically loaded, so the 
>persistence session support cannot work anymore.
This is the weirdest way to build PHP I've seen, which creates a lot of troubles for users and doesn't solve any problems.
I've already saw a lot of confusion from FreeBSD users that install PHP and discover that none of the modules (that are usually enabled by default) are there.
 [2005-10-17 21:06 UTC] justin at eckhouse dot com
I seem to be having the same issue, both with 5.0.5 and 5.1RC1 when using SOAP_PERSISTENCE_SESSION.

- Justin
 [2005-10-21 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2005-11-02 00:59 UTC] mir at miras dot org
Hi,

I would like this to be reopened because I have the same problems:

loke:~/Projekter/php/soap/basic$ dpkg -s php5.0
Package: php5.0
Status: install ok installed
Priority: optional
Section: interpreters
Installed-Size: 20
Maintainer: Piotr Roszatycki <dexter@debian.org>
Architecture: all
Version: 5.0.5-0.8
Provides: php5

Server:
<?php
    session_start();
    class HelloServer {
        private $count;

        function __construct() {
            $this->count = 0;
        }

        function sayhello() {
            $this->count++;
            return $this->count;
        }
    }
    $options = array("uri" => "http://test-uri/");
    $server = new SoapServer(NULL, $options);
    $server->setClass("HelloServer");
    $server->setPersistence(SOAP_PERSISTENCE_SESSION);
    $server->handle();
?>

Client:
<?php

    function format($s)
    {
        $s = str_replace("><", ">\n<", $s);
        return "<pre>" . htmlspecialchars($s) . "</pre>";
    }

    print "<html><head><title>Session Test</title></head><body>";
    $option = array(
        "location" => "http://localhost/~mir/soap/php5/session/soapSessionServer.php",
        "uri" => "http://test-uri/",
        "trace" => 1);
    $client = new SoapClient(NULL, $option);
    $arg = array();
    try
    {
        $response = $client->__soapCall("sayhello", $arg);
        print "<p>Response:<br>$response</p>";
    }
    catch(SoapFault $sf)
    {
        print "<p>Response:<br>" . $sf->getMessage() . "</p>\n";
    }

    print format($client->__getLastRequestHeaders()) . "\n";
    print format($client->__getLastRequest()) . "\n";
    print format($client->__getLastResponseHeaders()) . "\n";
    print format($client->__getLastResponse()) . "\n";
    print "</body></html>";
?>

Output - first time rune:
HTTP/1.1 200 OK
Date: Tue, 01 Nov 2005 23:05:25 GMT
Server: Apache/2.0.55 (Debian) mod_python/3.1.3 Python/2.3.5 PHP/5.0.5-Debian-0.8 mod_perl/2.0.1 Perl/v5.8.7
X-Powered-By: PHP/5.0.5-Debian-0.8
Set-Cookie: PHPSESSID=c6d215abd0930d3c48bb82dc9645b8ea; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 505
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8

Output - second time:
HTTP/1.1 200 OK
Date: Tue, 01 Nov 2005 23:23:09 GMT
Server: Apache/2.0.55 (Debian) mod_python/3.1.3 Python/2.3.5 PHP/5.0.5-Debian-0.8 mod_perl/2.0.1 Perl/v5.8.7
X-Powered-By: PHP/5.0.5-Debian-0.8
Set-Cookie: PHPSESSID=94b0f37c8de99c263a74b3f657d12f3a; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 505
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8

As can be seen the session id changes for every call. Looking for the cookie on the client shows the problem - the cookie is never stored on the client so succeding invocations does not send any session id back which causes the server to think this is a new session.
 [2005-11-02 01:17 UTC] brent at jeneral dot com
The workaround is to change all

#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)

back to 

#if HAVE_PHP_SESSION

in soap.c

I agree that this is an ongoing issue.  It seems as though there's an unresolved "discussion" as to who owns the problem.
 [2005-11-02 02:26 UTC] mir at miras dot org
Now it gets spookie.

I downgraded from the php5-5.0.5 from the maintainer of php5 on Debian to the official php5-5.0.5 in Sid and in this version it works. Checked soap.c in the official version with my former version and the showed to be identical!
 [2005-11-02 14:15 UTC] sniper@php.net
We do NOT support any 3rd party ports. We only support the releases we release. And making ext/session shared is just plain stupid.

 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC