• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

apache或者php,如何设置页面的cookies

php 搞代码 4年前 (2022-01-24) 14次浏览 已收录 0个评论

apache或者php,怎么设置页面的cookies?
curl一个网站,法国天气网。

返回的信息是

Merci d'accepter les cookies<br />Pour accepter les cookies :<br /><br />Sur Internet Explorer : Outils <mark>6来源gaodaimacom搞#^代%!码网</mark><strong>搞gaodaima代码</strong>> Options Internet > Confidentialité > Avancé <br />Sur Firefox: Outils > Options > Vie privée > Cookie > Accepter les cookies <br />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)<br /><br />大致意思是:<br /><br />谢谢您接受cookies<br />要接受Cookie:<br /><br />IE浏览器:工具> Internet选项>隐私>高级<br />在Firefox:工具>选项>隐私>饼干>接受Cookies<br />我们告诉你,你可能会反对cookie的配置您的计算机的CNIL的网站上详细登记。(http://www.cnil.fr)<br />

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


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:apache或者php,如何设置页面的cookies

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址