我正在使用PHP本机SOAP服务器类在CodeIgniter中创建SOAP服务器。 SOAP服务器工作得很好,但我有码码会话cookie的问题。会话cookie正在使用SOAP服务器的每个响应发送。我需要会话cookie for其他部分的应用程序,除了SOAP服务器。 有没有办法我可以禁用SEAR会话cookie,只需为应用程序中的一个SOAP服务器? 我搜索了stackoverflow和其他网站以获取信息,但没有找到任何有用的东西。

可能是我缺少显而易见的东西。

请把我指向正确的方向。

Edit

这是SOAP请求的HTTP响应:

HTTP/1.1 200 OK
Date: Fri, 10 Jan 2014 07:05:56 GMT
Server: Apache/2.2.3 (CentOS) DAV/2 PHP/5.3.3
X-Powered-By: PHP/5.3.3
Set-Cookie: fgdstagecookie=a%3A4%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%22076ceb992c6dff61e46d04d0c3d73d03%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A13%3A%22116.90.236.34%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A34%3A%22Apache-HttpClient%2F4.1.1+%28java+1.5%29%22%3Bs%3A13%3A%22last_activity%22%3Bi%3A1389337556%3B%7D7e8bb59c2753934d5a6265ab7964064c; path=/
Content-Length: 382
Cache-Control: no-store, no-cache, must-revalidate, private, max-age=0
Pragma: no-cache
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Connection: close
Content-Type: text/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns2:responseType xmlns:ns2="http://tempuri.org/response"><code>4</code><message>transaction does not exist or is not available</message><responseBody><responseStr>4</responseStr></responseBody></ns2:responseType></SOAP-ENV:Body></SOAP-ENV:Envelope>
.

我要删除的部分是Set-Cookie部分。

有帮助吗?

解决方案

返回响应或请求使用header_remove();功能

参考 http://www.php.net/manual/en/function.header-remove.php

<?php
 header("X-Foo: Bar");
 header("X-Bar: Baz");

 //remove specific header
 header_remove("X-Foo"); 

 //remove all headers
 header_remove(); 
?>
.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top