gpt4 book ai didi

php - 在 cookie header 之前或之后发送 HTTP header ?

转载 作者:可可西里 更新时间:2023-11-01 00:26:59 27 4
gpt4 key购买 nike

我想知道在发送 cookie 头之前或之后发送普通头是否有任何问题或区别。某些浏览器是否更喜欢标题的特定顺序?如果 cookie header 太大,后续 header 将永远不会被解析吗?

setcookie("TestCookie", $value);
header("Content-type: text/javascript");

header('Location: http://www.example.com/');
setcookie("TestCookie", $value);

setcookie("SuperLargeCookie", $massive_value);
setcookie("TinyCookie", $small_value);
header("Status: 404 Not Found");

最佳答案

没有区别。 Http 协议(protocol)没有指定 header 的顺序。浏览器也不根据 header 的顺序进行区分。

Http header 的总长度确实有限制。这个限制是由服务器而不是浏览器强加的。通常在 8K 和 16K 之间。然而,这是可配置的。

关于php - 在 cookie header 之前或之后发送 HTTP header ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4287747/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com