Home > Article > Backend Development > 如何去掉响应头信息中的Set-Cookie?
页面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>
即session默认是自动启动的。
php的session默认情况下,会将sess id 作为cookie发送给用户代理。