禁用php soap服务器的codeigniter会话cookie

时间:2014-01-10 06:48:37

标签: php codeigniter cookies soapserver

我正在使用php native soap server class在codeigniter中创建一个soap服务器。 soap服务器运行良好,但我遇到了codeiginter会话cookie的问题。会话cookie与soap服务器的每个响应一起发送。我需要除了soap服务器之外的应用程序的其他部分的会话cookie。 有没有办法我只能为应用程序中的控制器肥皂服务器禁用会话cookie? 我搜索了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部分。

1 个答案:

答案 0 :(得分:1)

在返回响应或请求之前使用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(); 
?>
相关问题