如何去掉响应头信息中的Set-Cookie?

WBOY
Release: 2016-06-06 20:46:20
Original
2524 people have browsed it

页面HTTP状态查询如下,目的是要做CDN加速,CDN那边说得去掉头信息中的Set-Cookie

返回状态码:200
网页返回HEAD信息如下
Date: Mon, 03 Mar 2014 09:02:08 GMT
Server: Apache/2.2.22 (Win64) PHP/5.4.3
X-Powered-By: ThinkPHP
Set-Cookie: PHPSESSID=assum1ediernlvg12ao3cf2ha2; path=/
Expires: Mon, 03 Mar 2014 12:02:08 GMT
Cache-Control: max-age=3600
Last-Modified: Sat, 01 Mar 2014 13:34:36 GMT
Vary: Accept-Encoding,User-Agent
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

回复内容:

页面HTTP状态查询如下,目的是要做CDN加速,CDN那边说得去掉头信息中的Set-Cookie

返回状态码:200
网页返回HEAD信息如下
Date: Mon, 03 Mar 2014 09:02:08 GMT
Server: Apache/2.2.22 (Win64) PHP/5.4.3
X-Powered-By: ThinkPHP
Set-Cookie: PHPSESSID=assum1ediernlvg12ao3cf2ha2; path=/
Expires: Mon, 03 Mar 2014 12:02:08 GMT
Cache-Control: max-age=3600
Last-Modified: Sat, 01 Mar 2014 13:34:36 GMT
Vary: Accept-Encoding,User-Agent
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

tp 默认的惯例配置中,有这么一行:

<code>/* SESSION设置 */
'SESSION_AUTO_START'    => true,    // 是否自动开启Session
</code>
Copy after login

即session默认是自动启动的。
php的session默认情况下,会将sess id 作为cookie发送给用户代理。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template