curl一个网站,法国天气网。
返回的信息是
merci d'accepter les cookies
pour accepter les cookies :
sur internet explorer : outils > options internet > confidentialité > avancé
sur firefox: outils > options > vie privée > cookie > accepter les cookies
nous vous informons que vous pouvez vous opposer à l'enregistrement de ces cookies en configurant votre ordinateur selon les modalités détaillées sur le site de la cnil. (http://www.cnil.fr)
大致意思是:
谢谢您接受cookies
要接受cookie:
ie浏览器:工具> internet选项>隐私>高级
在firefox:工具>选项>隐私>饼干>接受cookies
我们告诉你,你可能会反对cookie的配置您的计算机的cnil的网站上详细登记。(http://www.cnil.fr)
curlopt_header,true 之后,返回下述信息。
http/1.1 302 found date: thu, 24 jan 2013 16:09:14 gmt server: apache set-cookie: jknch=hcnkj; path=/; domain=meteofrance.com location: http://token.meteofrance.com/?u=%68%74%74%70%3a%2f%2f%66%72%61%6e%63%65%2e%6d%65%74%65%6f%66%72%61%6e%63%65%2e%63%6f%6d%2f%66%72%61%6e%63%65%2f%61%63%74%75%2f%61%63%74%75%3f%70%6f%72%74%6c%65%74%5f%69%64%3d%39%30%31%33%36%26%64%6f%63%75%6d%65%6e%74%5f%69%64%3d%32%37%33%35%34&s=%73%69%6d%2d%70%6f%72%74%61%69%6c&x=%dc%45%f1%a6%56%ad%a9%de content-length: 0 content-type: text/html http/1.1 302 found date: thu, 24 jan 2013 16:09:19 gmt server: apache location: http://france.meteofrance.com/nocookie.htm content-length: 0 connection: close content-type: text/html http/1.1 200 ok date: thu, 24 jan 2013 16:09:20 gmt server: apache etag: 8613ee-89f-4d0d0d2028c80 accept-ranges: bytes xcache: version 1.2 for apache 2.2 last-modified: thu, 24 jan 2013 15:39:23 gmt content-length: 2207 content-type: text/html
我想请教,这个功能是在apache还是php里设置的?一定要求客户端接受cookies才可以继续浏览?
------解决方案--------------------
本帖最后由 xuzuning 于 2013-01-25 09:51:15 编辑 解释一下返回的头
http/1.1 302
found date: thu, 24 jan 2013 16:09:14 gmt
server: apache
set-cookie: jknch=hcnkj; path=/; domain=meteofrance.com
location: http://token.meteofrance.com/?u=%68%74%74%70%3a%2f%2f%66%72%61%6e%63%65%2e%6d%65%74%65%6f%66%72%61%6e%63%65%2e%63%6f%6d%2f%66%72%61%6e%63%65%2f%61%63%74%75%2f%61%63%74%75%3f%70%6f%72%74%6c%65%74%5f%69%64%3d%39%30%31%33%36%26%64%6f%63%75%6d%65%6e%74%5f%69%64%3d%32%37%33%35%34&s=%73%69%6d%2d%70%6f%72%74%61%69%6c&x=%dc%45%f1%a6%56%ad%a9%de
content-length: 0
content-type: text/html
http/1.1 302
found date: thu, 24 jan 2013 16:09:19 gmt
server: apache
location: http://france.meteofrance.com/nocookie.htm
content-length: 0
connection: close
content-type: text/html
http/1.1 200 ok